All Projects → matpalm → ros-hc-sr04-node

matpalm / ros-hc-sr04-node

Licence: MIT license
raspberry pi c++ ROS hc-sr04 sonar node

Programming Languages

CMake
9771 projects
C++
36643 projects - #6 most used programming language
shell
77523 projects
python
139335 projects - #7 most used programming language

c++ ROS node wrapper for a set of hc-sr04 ultrasonic sonars.

hc-sr04

Publishes sensor_msgs::Range messages at 10Hz to /sonarN topics. Specifically populates range.

We include a node for a set of sonars, rather than a node per sonar, since we need to ensure only one sonar is measuring at a time (sonars can easily interfere with each other)

on rasp pi 2 uses ~2% cpu and <1% mem for 3 sonars (capping at a distance of 20cm)

REQUIRES running src/export_gpio_pins.sh to export pins otherwise need to run as root. (limitation of wiringPiSetupSys)

rostopic echo /sonar_0
---
header:
  seq: 525
  stamp:
    secs: 1462946345
    nsecs: 463606605
  frame_id: ''
radiation_type: 0
field_of_view: 0.0
min_range: 0.0
max_range: 20.0
range: 7.08620691299
---

TODOS

  • make hard coded pins in hc_sr04_node.cpp configurable
  • need some analysis on field_of_view
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].