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

mabe's profile - activity

2015-07-06 12:34:08 -0500 received badge  Famous Question (source)
2015-06-27 12:38:14 -0500 received badge  Notable Question (source)
2015-06-02 01:40:57 -0500 received badge  Enthusiast
2015-05-28 07:17:28 -0500 received badge  Popular Question (source)
2015-05-25 03:41:13 -0500 received badge  Supporter (source)
2015-05-19 23:46:22 -0500 received badge  Organizer (source)
2015-05-19 22:29:31 -0500 asked a question Publish PointCloud msg with Arduino Uno / rosserial

Hello,

I am using an Arduino Uno with an ultrasonic sensor. The us sensor is mounted on a servo which turns the sensor 90 degrees back and forth. Now I want to publish the coordinates of the detected obstacles using the sensor_msgs/PointCloud.

I had no problems with publishing the detected distances using float or range messages but when I try using PointClouds I always get error messages. I get two different error messages, which appear in no specific order (or at least I cannot see one). When I reupload the code to the arduino and try to start publishing with ROS it seems to be random which of the errors appears. I do not change anything in the setup or the code. I am using ROS and Rosserial both on Indigo.

I hope someone know a solution regarding this problem but as I am new to ROS I am also open to any other suggestions on how to publish the coordinates.

These are the different error messages:

~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1
[INFO] [WallTime: 1432029875.775153] ROS Serial Python Node
[INFO] [WallTime: 1432029875.778201] Connecting to /dev/ttyACM1 at 57600 baud
/opt/ros/indigo/lib/python2.7/dist-packages/rosserial_python/SerialClient.py:336: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.pub_diagnostics = rospy.Publisher('/diagnostics', diagnostic_msgs.msg.DiagnosticArray)
[INFO] [WallTime: 1432029878.258271] wrong checksum for msg length, length 0
[INFO] [WallTime: 1432029878.258495] chk is 0
[INFO] [WallTime: 1432029887.948041] wrong checksum for msg length, length 32
[INFO] [WallTime: 1432029887.948281] chk is 0
[ERROR] [WallTime: 1432029887.953545] Mismatched protocol version in packet: lost sync or rosserial_python is from different ros release than the rosserial client
[INFO] [WallTime: 1432029887.953721] Protocol version of client is unrecognized, expected Rev 1 (rosserial 0.5+)

~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1
[INFO] [WallTime: 1432031319.654376] ROS Serial Python Node
[INFO] [WallTime: 1432031319.657267] Connecting to /dev/ttyACM1 at 57600 baud
/opt/ros/indigo/lib/python2.7/dist-packages/rosserial_python/SerialClient.py:336: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.pub_diagnostics = rospy.Publisher('/diagnostics', diagnostic_msgs.msg.DiagnosticArray)
[ERROR] [WallTime: 1432031336.761629] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
[ERROR] [WallTime: 1432031351.762493] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
[ERROR] [WallTime: 1432031366.763851] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

This is my code:

#include <ros.h>
#include <ros/time.h>
#include <sensor_msgs/PointCloud.h>
#include <Wire.h>
#include <Servo.h> 
const float pi = 3.14159265359;

//Set up the ros node and publisher
sensor_msgs::PointCloud sonar_msg;
ros::Publisher pub_sonar("sonar", &sonar_msg);
ros::NodeHandle nh ...
(more)