ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The numpy serialization/deserialization stubs has been generated in the corresponding PKG.srv.*; So one can probably override the default serialize() deserialize() in the same manner as numpy_msg does. Take the rospy_tutorial/005_AddTwoInts for an example:

import ros.numpy_msg
from rospy_tutorials.srv import *
AddTwoInts._request_class = rospy.numpy_msg.numpy_msg(AddTwoIntsRequest)
AddTwoInts._response_class = rospy.numpy_msg.numpy_msg(AddTwoIntsResponse)
AddTwoIntsRequest = rospy.numpy_msg.numpy_msg(AddTwoIntsRequest)
AddTwoIntsResponse= rospy.numpy_msg.numpy_msg(AddTwoIntsResponse)

I haven't test the code myself. But this should give you some idea.

The numpy serialization/deserialization stubs has been generated in the corresponding PKG.srv.*; So one can probably override the default serialize() deserialize() in the same manner as numpy_msg does. Take the rospy_tutorial/005_AddTwoInts for an example:example, You'll probably need to add these new lines:

import ros.numpy_msg
from rospy_tutorials.srv import *
AddTwoInts._request_class = rospy.numpy_msg.numpy_msg(AddTwoIntsRequest)
AddTwoInts._response_class = rospy.numpy_msg.numpy_msg(AddTwoIntsResponse)
AddTwoIntsRequest = rospy.numpy_msg.numpy_msg(AddTwoIntsRequest)
AddTwoIntsResponse= rospy.numpy_msg.numpy_msg(AddTwoIntsResponse)

I haven't got a chance to test the code myself. But myself, but hope this should give you some idea.

The numpy serialization/deserialization stubs has been generated in the corresponding PKG.srv.*; So one can probably override the default serialize() deserialize() in the same manner as numpy_msg does. Take the rospy_tutorial/005_AddTwoInts for an example, You'll probably need to add these new lines:

import ros.numpy_msg
rospy.numpy_msg
AddTwoInts._request_class = rospy.numpy_msg.numpy_msg(AddTwoIntsRequest)
AddTwoInts._response_class = rospy.numpy_msg.numpy_msg(AddTwoIntsResponse)
AddTwoIntsRequest = rospy.numpy_msg.numpy_msg(AddTwoIntsRequest)
AddTwoIntsResponse= rospy.numpy_msg.numpy_msg(AddTwoIntsResponse)

I haven't got a chance to test the code myself, but hope this give you some idea.