This fork of the ping360_sonar
repository includes significant updates to support UDP communication and compatibility with ROS Noetic on Ubuntu 20.04. The following changes have been made:
- UDP Support: Replaced serial communication with UDP for device interaction. The device IP is set to "169.254.178.221" and port to "12345".
- ROS Noetic Compatibility: Updated the package to ensure compatibility with ROS Noetic and Ubuntu 20.04.
These changes enhance the flexibility and performance of the package, making it suitable for modern ROS environments and network-based communication.
A python ROS package for the BlueRobotics Ping360 Sonar. The package has been tested under ROS melodic and Ubuntu 16.04. This code is mostly experimental, expect that it changes often.
Keywords: ROS, package, ping360, ping360 emulator
The source code is released under a MIT license.
Get the latest stable release here.
- Robot Operating System (ROS) (middleware for robotics),
- OpenCV
- cv_bridge
Before building from source, install ping-protocol python lib:
pip install bluerobotics-ping
!Headsup! B.R. just updated their package with some breaking changes, make you sure you use version 0.0.9 for now.
To build from source, clone the latest version from this repository into your catkin workspace and compile the package using
cd catkin_workspace/src
git clone https://github.com/CentraleNantesRobotics/ping360_sonar.git
cd ../
catkin build
TODO
An example launch file has been provided example.launch:
Run the main node with:
roslaunch ping360_sonar example.launch
-
example.launch: contains the default parameteres to run the Ping360 Sonar, including the serial port and the baudrate to interface with the sonar. The rest of the parameters are documented here: Ping360 Documentation. The same parameters can also be reconfigured using the dynamic_reconfigure.
An emulated mode was added to test the package when you don't have the sonar. To run the emulated sonar, set the env variable to "true":
<env name="emulated_sonar" value="true" />
The results from the emulation should be:
Three extra parameters can be set to toggle specific topics, they are set to true by default.
<param name="enableImageTopic" value="True or False"/>
<param name="enableScanTopic" value="True or False"/>
<param name="enableDataTopic" value="True or False"/>
By default, the sensor does a full 360° rotation, but that can be changed by modifying the min and max scan angle values.
<param name="minAngle" value="0"/>
<param name="maxAngle" value="400"/>
Please note that these angle value are in GRAD and not DEG.
You can also enable or disable the sensor oscillation by setting the oscillate parameter.
<param name="oscillate" value="True or False"/>
While continuously rotating the sonar in a set FOV range (defined by the min and max angle parameters), it publishes two types of messages:
- The sonar's response data (the echo intensities for a given angle & range)
- A LaserScan msg with ranges detected using a certain intensity threshold:
- A black and white image using the date received from the sonar. Same as the one generated by the ping viewer.
-
/ping360_node/sonar/images
(sensor_msgs/Image)The generated sonar image. This topic can be toggled using the enableImageTopic parameter.
-
/ping360_node/sonar/data
(msg/SonarEcho)Publishes the raw sonar data in a custom message:
Header header #header info float32 angle # the measurement angle [rad] uint8 gain # Sonar Gain uint16 number_of_samples uint16 transmit_frequency # [kHz] uint16 speed_of_sound # [m/s] uint8 range # range value [m] uint8[] intensities # intensity data [0-255]. This is the actual data received from the sonar
This topic can be toggled using the enableDataTopic parameter.
-
/ping360_node/sonar/scan
(sensor_msgs/LaserScan)Publishes a LaserScan msg with ranges detected above a certain intensity threshold:
float32 angle_min = minAngle # start angle of the scan [rad] float32 angle_max = maxAngle # end angle of the scan [rad] float32 angle_increment # angular distance between measurements, calculated using the configured Step [rad] float32 range_min = .75 # minimum range value [m] float32 range_max = sonarRange # maximum range value, it's set to the configured sonarRange [m] float32[] ranges # calculated ranges that correspond to an intensity > threshold [m] float32[] intensities # sensor intensity data [0-255]
This topic can be toggled using the enableScanTopic parameter.
Note:
- ranges values < range_min or > range_max should be discarded
- don't forget to set the frame to sonar_frame when using Rviz
Please report bugs and request features using the Issue Tracker.
Henrique Martinez Rocamora 💻 |
Anas Mazouni 💻 |
tomlogan501 🤔 |
This project follows the all-contributors specification.
Contributions of any kind welcome! Please refer to our Contribution Guide