I am in the process of writing a player driver for my robot. I have the
basic driver done but I am running into problems writing a wrapper
driver that is designed to mate the ir and actarray interfaces (I have
some IR sensors mounted on servos). I am able to subscribe to the IR
and Actuator interfaces and can read data from them by sending a
PLAYER_MSGTYPE_REQ, but the server freezes when I send a
PLAYER_MSGTYPE_CMD. For example, I can read the IR poses with:
Message * Reply = this->ir_dev->Request(InQueue, PLAYER_MSGTYPE_REQ, PLAYER_IR_POSE, (void *) &cfg, sizeof(cfg), NULL);
But if I try to send a command to the servo like:
cmd.joint = 0;
cmd.position = (new_pose/(180/M_PI));
serv_mess = this->act_dev->Request(InQueue, PLAYER_MSGTYPE_CMD, PLAYER_ACTARRAY_POS_CMD, (void*)&cmd, sizeof(cmd), NULL, true);
The actuator will move but the server will no longer respond to
commands. After about 5 seconds the server begins reporting "warning :
tried to push onto a full message queue" alternating with "error :
tried to push 1/1 from 22:0".
How do I go about debugging this problem? Is the server supposed to
send a reply message when it receives a PLAYER_MSGTYPE_CMD? Or is the
problem that the client (overlying driver) is not reading from the
queue? It should be calling ProcessMessages() normally. Is the above
code the correct way to send a command to a subscribed driver from
within another driver?
It may be that I am just missing something basic, but the console
reports no messages that were not handled and I am unable to determine
exactly which way the messages are flowing.
I have searched the archives and found references to
for other people who have this problem, but I am unsure if it applies to
me. The example driver in examples/plugins/multidriver/ shows how to
subscribe to the device from another driver but does not include code
for sending commands to the driver.
I know this is sort of long and rambling but if someone could please
give me a nudge in the right direction I would appreciate it!
From: Brian Gerkey <brian@ge...> - 2007-04-19 15:52:57
On Mar 8, 2007, at 4:20 PM, Enigma wrote:
> I am in the process of writing a player driver for my robot.
> But if I try to send a command to the servo like:
> player_actarray_position_cmd_t cmd;
> cmd.joint = 0;
> cmd.position = (new_pose/(180/M_PI));
> Message *serv_mess;
> serv_mess = this->act_dev->Request(InQueue, PLAYER_MSGTYPE_CMD,
> PLAYER_ACTARRAY_POS_CMD, (void*)&cmd, sizeof(cmd), NULL, true);
Device::Request() is only for making requests. To send a command,