How to read LaserScan by Arduino?
Hi
I'm using Xtion sensor to get LaserScan data using the following commands:
$ roslaunch turtlebot_bringup minimal.launch
$ roslaunch rtabmap_ros demo_turtlebot_mapping.launch rgbd_odometry:=true
$ roslaunch rtabmap_ros demo_turtlebot_rviz.launch
I can read /scan which is type "sensor_msgs/LaserScan".
I want to use this data in Aurdoino board.
I think, I have to use the following headers in Arduino code :
#include <ros/ros.h>
#include <sensor_msgs/LaserScan.h>
and the following codes:
$ ros::NodeHandle nh;
$ ros::Subscriber sub = nh.subscribe<sensor_msgs::LaserScan>("scan", 1000, scanCallback);
Now how I can access to scan array?
I appreciate if you help me.
EDIT:
I could finally find the issue. My Arduino board cannot read large data with high rate of publishing. So I just publish a std_msgs::Float32 message with low publish rate.