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

serialize deserialize message in intraprocess publishing

asked 2014-05-10 22:58:26 -0600

MohsenTamiz gravatar image

updated 2014-05-10 22:58:45 -0600

Hi, everyone. i have one publisher that publishes data on a topic, and one subscriber that receives message from that topic. both publisher and subscriber are on the same node. ros intraprocess publishing indicates that if used shared_ptr serialization/deserialization will be ignored, for testing, i use other PC and connect to running roscore on robot and with rostopic echo, i can see publishing data. therefore i think serialization and deserialization happens. furthermore rostopic in the same PC shows publishing data. i think when i publish with shared_ptr, other nodes can't see the data, if they can, serialization/deserialization is being happend. please explain if i'm wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-11 04:29:08 -0600

dornhege gravatar image

serialization/deserialization will only be skipped if the connection is within the same node.

If you use rostopic echo or some other different program of course serialization must happen, otherwise it cannot work.

edit flag offensive delete link more

Comments

Thanks for your reply. Is it mean subscriber determines if a message should serialize or not? In class reference of Publish of ROS documentation message I found three methods that always do serialize for example this method: void ros::Publisher::publish( const boost::shared_ptr< M > & message)

MohsenTamiz gravatar image MohsenTamiz  ( 2014-05-11 19:55:52 -0600 )edit

It's handled internally. This is a special case.

dornhege gravatar image dornhege  ( 2014-05-12 00:03:28 -0600 )edit

As ROS class reference publisher said,"This version of publish will allow fast intra-process message-passing in the future", the shared_ptr transmision will be added in future. this feature is very important in my project, and i want to be sure about this capability. Is there any way to check this?

MohsenTamiz gravatar image MohsenTamiz  ( 2014-05-12 21:11:58 -0600 )edit

If you are relying on fast inner-node publications that work via topics http://wiki.ros.org/nodelet is probably what you are looking for.

dornhege gravatar image dornhege  ( 2014-05-12 21:59:18 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-10 22:58:26 -0600

Seen: 843 times

Last updated: May 11 '14