Skip to content

Repository files navigation

ROS 2 Autonomous Navigation Stack for ROSBOT Pro 2

N10P 2D LiDAR + D455 Human Perception + Path Following

Hardware Required for the System:

  1. LSLIDAR N10P
  2. Intel Realsense D455
  3. Rosbot Pro 2 (Ackermann-style robot)

Project Node Structure

  1. Path Follower - Node for path-based navigation
  2. Human Behaviour - Node for human detection and tracking
  3. Obstacle avoidance - Node for obstacle avoidance using the 2D Planar Lidar
  4. Navigation Manager - Node for command prioritization
  5. Navigation to Rosbot - Node that converts the navigation into bash /cmd_vel

The architecture is intentionally made to separate perception, decision-making, and robot control.

N10P /scan

The N10P publishes /scan

This provides the information of:

header.frame_id
angle_min
angle_max
angle_increment
range_min
range_max
ranges intensities

Obstacle Avoidance Node

Package:

obstacle_avoidance

Executable:

obstacle_avoidance_node

Run with:

ros2 run obstacle_avoidance obstacle_avoidance_node

The node subscribes to:

/scan

and publishes:

/obstacle_state

Message type:

navigation_msgs/msg/ObstacleState

The message contains:

string state float32 distance

The obstacle avoidance node is responsible for converting raw LiDAR measurements into a simplified navigation state.


Obstacle States

CLEAR

Indicates that no obstacle has been detected inside the configured danger region.

Example:

state: CLEAR distance: 4.5

The navigation manager is allowed to continue normal navigation.


CAUTION

Indicates that an obstacle is approaching the configured caution distance.

Example:

state: CAUTION distance: 1.2

The navigation manager reduces the forward velocity while maintaining the path follower's steering command.


BLOCKED

Indicates that an obstacle is inside the configured stopping distance.

Example:

state: BLOCKED distance: 0.6

The navigation manager generates:

linear_velocity: 0.0 angular_velocity: 0.0 state: STOP

The robot therefore stops.


NO_SCAN

Indicates that a valid LiDAR measurement is unavailable.

This is treated as a safety condition.

The navigation manager stops the robot instead of assuming the environment is clear.


Parameters Used:

Front sector: ±30° Stop distance: 0.80 m Slow distance: 1.50 m Scan timeout: 0.30 s

Therefore:

distance <= 0.80 m = BLOCKED

and approximately:

0.80 m < distance <= 1.50 m = CAUTION

while:

distance > 1.50 m = CLEAR

The exact behavior depends on the implementation of the current obstacle avoidance node.


Navigation Manager

Package:

navigation_manager

Executable:

navigation_manager_node

Run with:

ros2 run navigation_manager navigation_manager_node

The navigation manager is the central decision-making node.

It subscribes to:

/path_command /human_command /obstacle_state

and publishes:

/navigation_command

The important architectural change for the N10P integration is that the navigation manager now consumes:

/obstacle_state

using:

navigation_msgs/msg/ObstacleState

rather than expecting an obstacle


Navigation Priority

The current priority is:

  1. Obstacle Safety
  2. Human Behavior
  3. Path Following
  4. STOP if no valid command exists

This means obstacle safety has the highest priority.

Operation Notes 1

After changing a package:

cd ~/ros2_ws

#Build the changed package:

colcon build --packages-select navigation_manager

#For the obstacle avoidance package:

colcon build --packages-select obstacle_avoidance

#For the robot command interface:

colcon build --packages-select navigation_to_rosbot

#After building:

#source ~/ros2_ws/install/setup.bash

#If multiple packages were changed:

colcon build --packages-select \
    obstacle_avoidance \
    navigation_manager \
    navigation_to_rosbot

#Then:

source ~/ros2_ws/install/setup.bash


Operation Notes 2

#List packages
ros2 pkg list | grep -E \
"obstacle|navigation|path|human"
#List nodes
ros2 node list
#List topics
ros2 topic list
#Check node information
ros2 node info /navigation_manager
#Check topic type
ros2 topic type /scan
#Check topic rate
ros2 topic hz /scan
#Echo one message
ros2 topic echo /scan --once
#Inspect message definition
ros2 interface show navigation_msgs/msg/ObstacleState

#Expected:

string state
float32 distance

#Inspect the navigation command:

ros2 interface show navigation_msgs/msg/NavigationCommand


Important points on the nodes

obstacle_avoidance
    |
    +-- Reads /scan
    |
    +-- Determines obstacle state
    |
    +-- Publishes /obstacle_state


navigation_manager
    |
    +-- Reads /path_command
    |
    +-- Reads /human_command
    |
    +-- Reads /obstacle_state
    |
    +-- Determines command priority
    |
    +-- Publishes /navigation_command


navigation_to_rosbot
    |
    +-- Reads /navigation_command
    |
    +-- Converts NavigationCommand → Twist
    |
    +-- Publishes /cmd_vel

Do not merge these responsibilities unless there is a strong architectural reason.


Verifications:

Before autonomous driving, verify all of the following:

LiDAR publishes consistently. /scan is approximately 10 Hz. LiDAR frame is correctly positioned relative to the robot. Obstacle detection does not produce excessive false positives. Invalid LiDAR returns are handled correctly. BLOCKED produces zero velocity. CAUTION actually reduces velocity. A missing LiDAR scan does not result in forward motion. Navigation manager command timeout works. Robot base/controller has its own appropriate command timeout. /cmd_vel is not being published by competing nodes. Emergency/manual stop remains available. Tests are first performed with the robot physically prevented from moving.


Installing Rosbot Pro Drivers


cd ~/ros2_ws/src

git clone https://github.com/robotverseny/drivers


Required packages


sudo apt update



sudo apt install libpcap0.8-dev libpcl-dev libboost-all-dev ros-jazzy-nav2-msgs ros-jazzy-ackermann-msgs ros-jazzy-tf2-msgs ros-jazzy-tf2-geometry-msgs ros-jazzy-joint-state-publisher ros-jazzy-robot-localization ros-jazzy-usb-cam ros-jazzy-foxglove*



sudo apt install libpcap0.8-dev libpcl-dev libboost-all-dev ros-jazzy-nav2-msgs ros-jazzy-ackermann-msgs ros-jazzy-tf2-msgs ros-jazzy-tf2-geometry-msgs ros-jazzy-joint-state-publisher ros-jazzy-robot-localization ros-jazzy-usb-cam ros-jazzy-foxglove*



rosdep install --from-paths src --ignore-src -y

rosdep update


Recommended adaptations for the platform before build

Building the packages


cd ~/ros2_ws

colcon build --symlink-install --packages-select serial wheeltec_robot_msg lslidar_msgs lslidar_driver turn_on_wheeltec_robot wheeltec_robot_urdf usb_cam_launcher wheeltec_py_package



sudo nano /etc/udev/rules.d/usb.rules



sudo su

echo  'KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60",ATTRS{serial}=="0002", MODE:="0777", GROUP:="dialout", SYMLINK+="wheeltec_controller"' >/etc/udev/rules.d/wheeltec_controller.rules
echo  'KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60",ATTRS{serial}=="0001", MODE:="0777", GROUP:="dialout", SYMLINK+="wheeltec_laser"' >/etc/udev/rules.d/rplidar_laser.rules
echo  'KERNEL=="ttyUSB*", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60",ATTRS{serial}=="0003", MODE:="0777", GROUP:="dialout", SYMLINK+="wheeltec_laser"' >/etc/udev/rules.d/ld14.rules
echo  'KERNEL=="ttyCH343USB*", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4",ATTRS{serial}=="0002", MODE:="0777", GROUP:="dialout", SYMLINK+="wheeltec_controller"' >/etc/udev/rules.d/wheeltec_wheeltec.rules

service udev reload
sleep 2
service udev restart

sleep 2
udevadm control --reload-rules
sleep 2
udevadm trigger



/dev/wheeltec_controller  /dev/wheeltec_laser



ros2 launch turn_on_wheeltec_robot turn_on_wheeltec_robot.launch.py lidar:=true camera:=true foxglove:=true joy:=false


About

Rosbot Pro Autonomy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages