I created a quick patch unfortunately I've never worked with the gripper and I
don't have any test case ready, so I don't know if it will work the way it's
supposed to.
On Wednesday 06 September 2006 11:46, Sean Verret wrote:
> I believe things changed in the following revision of
> player/libplayercore/player.h
>
> revision 1.108
> date: 2006/07/10 16:55:37; author: gerkey; state: Exp; lines: +100 -90
> applied patch 1483740, which implements the new gripper interface,
> modifying the C and C++ client libs, along with stage
>
> Any advice on how to change the file in gazebo so it is compatible with
> these changes would be nice.
>
> Thanks
> Sean
>
____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.
Index: gazebo/player/GripperInterface.cc
===================================================================
RCS file: /cvsroot/playerstage/code/gazebo/player/GripperInterface.cc,v
retrieving revision 1.2
diff -u -p -r1.2 GripperInterface.cc
--- gazebo/player/GripperInterface.cc 3 Mar 2006 21:11:04 -0000 1.2
+++ gazebo/player/GripperInterface.cc 6 Sep 2006 20:44:27 -0000
@@ -73,31 +73,56 @@ int GripperInterface::ProcessMessage(Mes
{
if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
- PLAYER_GRIPPER_CMD_STATE, this->device_addr))
+ PLAYER_GRIPPER_CMD_OPEN, this->device_addr))
{
- if( hdr->size != sizeof(player_gripper_cmd_t) )
- {
- printf( "wrong size gripper command packet (%d/%d bytes)",
- (int)hdr->size, (int)sizeof(player_gripper_cmd_t) );
+ gz_gripper_lock(this->iface, 1);
- return -1;
- }
+ this->iface->data->cmd = 1;
- player_gripper_cmd_t *cmd;
+ gz_gripper_unlock(this->iface);
+
+ return 0;
+ } else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
+ PLAYER_GRIPPER_CMD_CLOSE, this->device_addr))
+ {
+ gz_gripper_lock(this->iface, 1);
- assert(hdr->size >= sizeof(player_gripper_cmd_t));
- cmd = (player_gripper_cmd_t*) data;
+ this->iface->data->cmd = 2;
+ gz_gripper_unlock(this->iface);
+
+ return 0;
+ } else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
+ PLAYER_GRIPPER_CMD_STOP, this->device_addr))
+ {
gz_gripper_lock(this->iface, 1);
- this->iface->data->cmd = (int)(cmd->cmd);
+ this->iface->data->cmd = 3;
gz_gripper_unlock(this->iface);
- return 0;
- }
+
+ return 0;
+ } else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
+ PLAYER_GRIPPER_CMD_STORE, this->device_addr))
+ {
+ gz_gripper_lock(this->iface, 1);
+
+ this->iface->data->cmd = 7;
+
+ gz_gripper_unlock(this->iface);
+
+ return 0;
+ } else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
+ PLAYER_GRIPPER_CMD_RETRIEVE, this->device_addr))
+ {
+ gz_gripper_lock(this->iface, 1);
- // is it a geometry request?
- if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
+ this->iface->data->cmd = 8;
+
+ gz_gripper_unlock(this->iface);
+
+ return 0;
+ } else if(Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
PLAYER_GRIPPER_REQ_GET_GEOM,
this->device_addr))
{
@@ -106,9 +131,18 @@ int GripperInterface::ProcessMessage(Mes
player_gripper_geom_t pgeom;
pgeom.pose.px = 0;
pgeom.pose.py = 0;
- pgeom.pose.pa = 0;
- pgeom.size.sw = 0;
- pgeom.size.sl = 0;
+ pgeom.pose.pz = 0;
+ pgeom.pose.proll = 0;
+ pgeom.pose.ppitch = 0;
+ pgeom.pose.pyaw = 0;
+ pgeom.outer_size.sw = 0;
+ pgeom.outer_size.sl = 0;
+ pgeom.outer_size.sh = 0;
+ pgeom.inner_size.sw = 0;
+ pgeom.inner_size.sl = 0;
+ pgeom.inner_size.sh = 0;
+ pgeom.num_beams = 0;
+ pgeom.capacity = 0;
this->driver->Publish(this->device_addr, respQueue,
PLAYER_MSGTYPE_RESP_ACK,
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Playerstage-gazebo mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-gazebo