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

Yes and no. Yes if you want to parcel additional data in the same message with a JointState message you will have to create an custom message that contains a jointstate message as one message field and some other fields for your specifc data. And no, Rviz will no longer understand your custom message are ros message do not provide some kind of inheritance such that a base message would still be available in a derived type without changes of the application code.

As I guess this it not the answer you where hoping for I'd like to suggest another workaround. If you want to publish some data along with the jointstate from one of your nodes to another of your nodes (I guess that's the case as rviz etc. cannot be your target subscriber as they won't "understand" your additional information anyway) you can publish the jointstate message along with another additional message of a custom type. Be sure to add message Header field to your custom message and copy exactly the same timestamp to the message header in the jointstate message and your custom message.

Then in your subscribing node(s) set up a message filter for synchronization with exact time policy: http://wiki.ros.org/message_filters#ExactTime_Policy

Then you get a common callback for the jointstate message and your custom message with additional information and you can do the processing of the combined data there!

Yes and no. Yes if you want to parcel additional data in the same message with a JointState message you will have to create an custom message that contains a jointstate message as one message field and some other fields for your specifc data. And no, Rviz will no longer understand your custom message are as ros message do not provide some kind of inheritance such that a base message would still be available in a derived type without changes of the application code.

As I guess this it not the answer you where hoping for I'd like to suggest another workaround. If you want to publish some data along with the jointstate from one of your nodes to another of your nodes (I guess that's the case as rviz etc. cannot be your target subscriber as they won't "understand" your additional information anyway) you can publish the jointstate message along with another additional message of a custom type. Be sure to add message Header field to your custom message and copy exactly the same timestamp to the message header in the jointstate message and your custom message.

Then in your subscribing node(s) set up a message filter for synchronization with exact time policy: http://wiki.ros.org/message_filters#ExactTime_Policy

Then you get a common callback for the jointstate message and your custom message with additional information and you can do the processing of the combined data there!

Yes and no. Yes if you want to parcel additional data in the same message with a JointState message you will have to create an custom message that contains a jointstate message as one message field and some other fields for your specifc data. And no, Rviz will no longer understand your custom message as ros message messages do not provide some kind of inheritance such that a base message would still be available in a derived type without changes of the application code.

As I guess this it not the answer you where hoping for I'd like to suggest another workaround. If you want to publish some data along with the jointstate from one of your nodes to another of your nodes (I guess that's the case as rviz etc. cannot be your target subscriber as they won't "understand" your additional information anyway) you can publish the jointstate message along with another additional message of a custom type. Be sure to add message Header field to your custom message and copy exactly the same timestamp to the message header in the jointstate message and your custom message.

Then in your subscribing node(s) set up a message filter for synchronization with exact time policy: http://wiki.ros.org/message_filters#ExactTime_Policy

Then you get a common callback for the jointstate message and your custom message with additional information and you can do the processing of the combined data there!