61 if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
62 PLAYER_ACTARRAY_REQ_GET_GEOM,
69 player_actarray_actuatorgeom_t actuator = {0};
72 actuator.type = PLAYER_ACTARRAY_TYPE_LINEAR;
74 player_actarray_geom_t pgeom = {0};
75 pgeom.base_pos.px = geom.
pose.
x;
76 pgeom.base_pos.py = geom.
pose.
y;
77 pgeom.base_pos.pz = geom.
pose.
z;
79 pgeom.base_orientation.pyaw = geom.
pose.
a;
81 pgeom.actuators_count = 1;
82 pgeom.actuators = &actuator;
85 PLAYER_MSGTYPE_RESP_ACK,
86 PLAYER_ACTARRAY_REQ_GET_GEOM,
91 else if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
92 PLAYER_ACTARRAY_CMD_POS,
95 player_actarray_position_cmd_t &cmd = *
reinterpret_cast<player_actarray_position_cmd_t*
> (data);
96 actmod->
GoTo(cmd.position);
100 else if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
101 PLAYER_ACTARRAY_CMD_SPEED,
104 player_actarray_speed_cmd_t &cmd = *
reinterpret_cast<player_actarray_speed_cmd_t*
> (data);
111 PRINT_WARN2(
"actuator doesn't support msg with type %d subtype %d",
112 hdr->type, hdr->subtype);
121 player_actarray_actuator_t act = {0};
125 act.state = PLAYER_ACTARRAY_ACTSTATE_MOVING;
127 act.state = PLAYER_ACTARRAY_ACTSTATE_IDLE;
129 player_actarray_data_t actdata = {0};
130 actdata.actuators_count = 1;
131 actdata.actuators = &act;
136 PLAYER_MSGTYPE_DATA, PLAYER_ACTARRAY_DATA_STATE,
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
#define PRINT_WARN2(m, a, b)
meters_t z
location in 3 axes
void SetSpeed(double speed)
double GetMinPosition() const
double GetMaxPosition() const
InterfaceActArray(player_devaddr_t addr, StgDriver *driver, ConfigFile *cf, int section)
radians_t a
rotation about the z axis.
virtual void Publish(void)
double GetPosition() const