2023-05-12 15:46:51 +00:00
|
|
|
/************************TRICK HEADER*************************
|
|
|
|
PURPOSE:
|
|
|
|
( Simulate kinematic, planar 2 degree-of-freedom manipulator )
|
|
|
|
LIBRARY DEPENDENCIES:
|
|
|
|
(
|
|
|
|
(manipulator/manipulator.cc)
|
|
|
|
)
|
|
|
|
*************************************************************/
|
2024-05-23 15:12:27 +00:00
|
|
|
#define TRICK_NO_MONTE_CARLO
|
|
|
|
#define TRICK_NO_MASTERSLAVE
|
|
|
|
#define TRICK_NO_INSTRUMENTATION
|
|
|
|
#define TRICK_NO_REALTIMEINJECTOR
|
|
|
|
#define TRICK_NO_ZEROCONF
|
2023-05-12 15:46:51 +00:00
|
|
|
#include "sim_objects/default_trick_sys.sm"
|
2024-05-23 15:12:27 +00:00
|
|
|
|
2023-05-12 15:46:51 +00:00
|
|
|
##include "include/trick/exec_proto.h"
|
|
|
|
##include "manipulator/manipulator.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();
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
ManipulatorSimObject Manip2D(2);
|
|
|
|
|
|
|
|
IntegLoop armIntegLoop(0.050) Manip2D;
|