Hi
I am starting rosserial with rauslaunch and the following configuration (roscore is running separatly):
<launch>
<node pkg="rosserial_python" type="serial_node.py" name="robby_node">
<param name="port" value="/dev/serial0" />
<param name="baud" value="500000" />
</node>
</launch>
My Core2-ROS (RPi) is running with this setup:
nh.getHardware()->initWithDevice(&RPi);
nh.initNode();
and publishing a joint_state message and subscribing a cmd_vel message.
When I subscribe the joint_state message with rostopic echo joint_state, the process dies after a short while (seuquence counter between 80 and 2000) with this output:
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/rosserial_python/serial_node.py", line 89, in <module>
client.run()
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 504, in run
self.callbacks[topic_id](msg)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rosserial_python/SerialClient.py", line 107, in handlePacket
m.deserialize(data)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/sensor_msgs/msg/_JointState.py", line 199, in deserialize
raise genpy.DeserializationError(e) #most likely buffer underfill
genpy.message.DeserializationError: unpack requires a string argument of length 5624
[robby_node-1] process has died [pid 3825, exit code 1, cmd /opt/ros/kinetic/lib/rosserial_python/serial_node.py __name:=robby_node __log:=/home/husarion/.ros/log/972ecebc-3454-11e8-932b-b827eb5b9192/robby_node-1.log].
log file: /home/husarion/.ros/log/972ecebc-3454-11e8-932b-b827eb5b9192/robby_node-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr
the mentioned log has this contents:
[rospy.client][INFO] 2018-03-31 14:21:09,648: init_node, name[/robby_node], pid[3825]
[xmlrpc][INFO] 2018-03-31 14:21:09,650: XML-RPC server binding to 0.0.0.0:0
[xmlrpc][INFO] 2018-03-31 14:21:09,653: Started XML-RPC server [http://core2-ros:46525/]
[rospy.init][INFO] 2018-03-31 14:21:09,653: ROS Slave URI: [http://core2-ros:46525/]
[rospy.impl.masterslave][INFO] 2018-03-31 14:21:09,654: _ready: http://core2-ros:46525/
[rospy.registration][INFO] 2018-03-31 14:21:09,660: Registering with master node http://localhost:11311
[xmlrpc][INFO] 2018-03-31 14:21:09,660: xml rpc node: starting XML-RPC server
[rospy.init][INFO] 2018-03-31 14:21:09,755: registered with master
[rospy.rosout][INFO] 2018-03-31 14:21:09,757: initializing /rosout core topic
[rospy.rosout][INFO] 2018-03-31 14:21:09,772: connected to core topic /rosout
[rospy.simtime][INFO] 2018-03-31 14:21:09,782: /use_sim_time is not set, will not subscribe to simulated time [/clock] topic
[rosout][INFO] 2018-03-31 14:21:09,804: ROS Serial Python Node
[rosout][INFO] 2018-03-31 14:21:09,848: Connecting to /dev/serial0 at 500000 baud
[rospy.internal][INFO] 2018-03-31 14:21:10,057: topic[/rosout] adding connection to [/rosout], count 0
[rosout][INFO] 2018-03-31 14:21:12,057: Note: publish buffer size is 512 bytes
[rosout][INFO] 2018-03-31 14:21:12,060: Setup publisher on joint_states [sensor_msgs/JointState]
[rosout][INFO] 2018-03-31 14:21:12,084: Note: subscribe buffer size is 512 bytes
[rosout][INFO] 2018-03-31 14:21:12,087: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[rosout][INFO] 2018-03-31 14:21:51,420: wrong checksum for topic id and msg
[rospy.internal][INFO] 2018-03-31 14:21:53,921: topic[/joint_states] adding connection to [/rostopic_3847_1522498913455], count 0
[rosout][INFO] 2018-03-31 14:21:56,070: wrong checksum for topic id and msg
[rosout][INFO] 2018-03-31 14:21:58,578: wrong checksum for topic id and msg
[rosout][INFO] 2018-03-31 14:22:01,021: wrong checksum for topic id and msg
[rospy.core][INFO] 2018-03-31 14:22:31,389: signal_shutdown [atexit]
[rospy.internal][INFO] 2018-03-31 14:22:31,435: topic[/joint_states] removing connection to /rostopic_3847_1522498913455
[rospy.internal][INFO] 2018-03-31 14:22:31,439: topic[/rosout] removing connection to /rosout
[rospy.impl.masterslave][INFO] 2018-03-31 14:22:31,441: atexit
I have no idea why this happens. May be the baudrate is too high!?
How can I set the baudrate between Core2 and RPi?
Any help is appreciated.
Michael