mirror of
https://github.com/nasa/trick.git
synced 2025-06-15 13:48:18 +00:00
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
/************************TRICK HEADER*************************
|
|
PURPOSE:
|
|
( Simulate kinematic, planar 2 degree-of-freedom manipulator )
|
|
LIBRARY DEPENDENCIES:
|
|
(
|
|
(manipulator/manipulator.cc)
|
|
)
|
|
*************************************************************/
|
|
#define TRICK_NO_MONTE_CARLO
|
|
#define TRICK_NO_MASTERSLAVE
|
|
#define TRICK_NO_INSTRUMENTATION
|
|
#define TRICK_NO_REALTIMEINJECTOR
|
|
#define TRICK_NO_ZEROCONF
|
|
#include "sim_objects/default_trick_sys.sm"
|
|
|
|
##include "include/trick/exec_proto.h"
|
|
##include "manipulator/manipulator.hh"
|
|
|
|
##include "jammy/jammy.hh"
|
|
|
|
class ManipulatorSimObject : public Trick::SimObject
|
|
{
|
|
|
|
public:
|
|
PlanarManip robot;
|
|
|
|
ManipulatorSimObject(int ndof): robot(ndof)
|
|
{
|
|
(0.050, "scheduled") robot.calcKinematics();
|
|
(0.050, "scheduled") robot.control();
|
|
("derivative") robot.stateDeriv();
|
|
("integration") trick_ret = robot.updateState();
|
|
}
|
|
|
|
};
|
|
|
|
class garbageString : public Trick::SimObject
|
|
{
|
|
public:
|
|
JarOfJam *jamJar;
|
|
JarOfJam jammyJarry[3];
|
|
|
|
garbageString()
|
|
{
|
|
jamJar = (JarOfJam *)TMM_declare_var_1d("JarOfJam", 3);
|
|
jamJar[0].blackberry = "Yes";
|
|
jamJar[1].blackberry = "Love it";
|
|
jamJar[2].blackberry = "Great for pies.";
|
|
|
|
}
|
|
}
|
|
|
|
ManipulatorSimObject Manip2D(2);
|
|
garbageString letsFindSomeTrash;
|
|
|
|
IntegLoop armIntegLoop(0.050) Manip2D;
|