ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
782 stars 773 forks source link

Create a gazebo_ros_sonar plugin #694

Open mrmouss opened 6 years ago

mrmouss commented 6 years ago

I have noticed that most people simulate sonar sensors using ros_gazebo_range plugin which in turn uses gazebo's RayPlugin. However, the behavior is not identical. When the sonar beam touches the floor it doesn't get reflected back to the receiver, and hence the measured distance is not the distance from the sensor to the floor. The gazebo_ros_range plugin uses a ray sensor as its source which is different than a sonar sensor (check the sdf format for this). What we need is a new plugin that uses SonarSensor and SonarPlugin to simulate the real behavior in ROS. I have developed a new plugin inspired by ros_gazebo_range but it seems that RaySensor and SonarSensor don't use the same axes. (for RaySensor distance is toward the +x-axis but in SonarSensor it is toward -z-axis). I created an additional fake link to be able to simulate the behavior but I don't think it's the best solution. Let me know if you're interested in the code I wrote.

j-rivero commented 6 years ago

Hello Moussab:

Thanks for your intentions of sharing your code. You are very welcome to submit a PR for this repository with your code so we can review it.