How to get Hokuyo LiDAR sensor data using sensors.hh?

asked 2020-06-28 19:46:23 -0500

minx gravatar image

Hello, Developers!

I'm trying to build a SILS (or SITL) using Gazebo with Ardupilot plugin.

I added Hokuyo LiDAR on the iris-quadcopter.

And I added some codes like bellow in to send lidar sensor data (ex, distance...).

const double range1 = this->dataPtr->rangefinderSensor->Range(0);

I added the code under the SendState function to use RaySensor.hh, but it does not work :(.... The Gazebo is just stopped.

Of course, "rangefinderSonsor" is the pointer of Raysensorptr. link

  public: sensors::RaySensorPtr rangefinderSensor;

My ROS version is ROS-Melodic and Gazebo is version 9. Is there anything wrong on my method???

edit retag flag offensive close merge delete