ROS package for autonomous navigation of Pioneer P3-DX robot using potential fields algorithm in Gazebo simulation.
- ROS Noetic (recommended)
- Ubuntu 20.04
- Gazebo (comes with ROS desktop-full installation)
- Pioneer P3DX packages:
git clone https://github.com/mario-serna/pioneer_p3dx_model.git ~/catkin_ws/src/p3dx_gazebo
-
Clone this repository to your catkin workspace:
cd ~/catkin_ws/src git clone https://github.com/Jakson-Almeida/p3dx_potential_fields.git
-
Build the package:
cd ~/catkin_ws catkin_make source devel/setup.bash
Launch the Gazebo simulation with potential fields navigation:
roslaunch p3dx_potential_fields p3dx_world.launch- In a new terminal, start the potential fields:
rosrun p3dx_potential_fields p3dx_potential_field.py
Enter goal coordinates when prompted in the terminal.
-
In a new terminal, start the visualization:
rosrun p3dx_potential_fields p3dx_view.py
-
In the visualization window:
- Press SPACE to clear the visualization
- Use mouse scroll to zoom in/out
- Implements potential field algorithm
- Subscribes to:
/RosAria/odom(robot pose)/RosAria/laser/scan(laser data)
- Publishes to:
/RosAria/cmd_vel(velocity commands)
- Visualization tool showing:
- Robot position (blue)
- Obstacles (red)
- Trajectory (green)
- Implements potential field algorithm
- Subscribes to:
/RosAria/odom(robot pose)/RosAria/laser/scan(laser data)
- Publishes to:
/RosAria/cmd_vel(velocity commands)
- Visualization tool showing:
- Obstacles (red)
- Trajectory (green)
- Interactive goal input via terminal
You can adjust these parameters in the code:
K_att: Attractive force gainK_rep: Repulsive force gainepsilon_0: Influence distance of obstaclesv_max: Maximum linear velocityomega_max: Maximum angular velocitytol: Goal tolerance distance
-
To change the world:
- Modify
worlds/mundo_corredor.world - Update the path in the launch file
- Modify
-
To tune the potential fields:
- Edit the parameters in
p3dx_potential_field.py
- Edit the parameters in
