This is a ROS package for collision avoidance Rpi car.
- RPI model 3 with Ubuntu mate 18.04 OS
- Arduino Uno
- DC motor with encoder
- RpLidar A1
- ROS melodic
- ROS serial download
- motor_iface.ino
This file conteains motor controls code to DC motor. Including a pair of PID controller for both wheels, a ROS serial topic for receiving PWM value from RPi, encoder receiver and publishing wheel velocity to Rpi.
- src/odom.cpp
Receiving wheels velocity from Arduino, and integrating them to wheel odometry for localization.
- tf_publisher.cpp
Receiving wheel odometry from odom.cpp, and publishing it to tf.
- obstacle_detect.cpp
Receiving point cloud from RpLidar, removing noisy points, and clustering continuous point as obstacle. Calculating the nearest obstacle as repulsive force generation point.
- potential_field.cpp
Generating repulsive force from the nearest obstacle, attractive force from the goal. Convert the desired velocity to PWM value of two wheels by inverse Kinematics.
- Run up RpLidar node first.
- Start localization node.
roslaunch [pkg_name] localization.launch
Should modify USB port of Arduino.
- Start main node.
roslaunch [pkg_name] run.launch