- Ubuntu 20.04
- ROS 1 Noetic
-
Install Turtlebot3 & Rplidar Packages: Ensure that the Turtlebot3 and rplidar are installed on your system.
-
Clone Repository
Clone the repository to your ROS workspace (src
folder).
git clone https://github.com/SwxTemp/Create-Robot-Navigation.git
- Update USB Serial Port Names:
- Navigate to the following files:
create_robot/create_bringup/config/default.yaml
rplidar_ros/launch/rplidar_a1.launch
- Update the USB serial port names as needed. Typically, one is named USB1 and the other is named USB0.
- Build Workspace:
catkin build
Build your ROS workspace.
If you encounter any errors, try clean the workspace and build again:
catkin clean
- Launch Navigation System:
roslaunch create_navigation create_navigation.launch
- This launch command will automatically perform the following tasks:
- Initialize the lidar a1
- Start the iRobot Create2
- Launch the Map Server
- Run the AMCL (Adaptive Monte Carlo Localization) Node
- Activate the Move Base
- Launch Rviz for visualization
roscore
roslaunch create_gazebo create_world.launch
roslaunch create_navigation create_navigation.launch map_file:=$HOME/map/gix_map_2f.yaml
-
The default world model is
gix-2f
that you can get in world folder -
The default map_file is
gix_map_2f.yaml
andgix_map_2f.pgm
-
Remember to change the map_file with your local file position
-
You can also use the following command to visualize robot in Rviz:
roslaunch create_gazebo create_gazebo_rviz.launch
-
And then use teleop tool to control the robot:
roslaunch create_teleop create_teleop.launch
- Open a world model:
roslaunch create_gazebo create_world.launch
- Run slam launch file:
roslaunch create_slam create_slam.launch slam_methods:=gmapping
- Control robot move:
roslaunch create_teleop create_teleop.launch
- Save the map:
rosrun map_server map_saver -f ~/path/to/save
- Connect with the physical robot
- Run slam launch file:
roslaunch create_slam create_slam.launch slam_methods:=gmapping
- Control robot move:
roslaunch create_teleop create_teleop.launch
- Save the map:
rosrun map_server map_saver -f ~/path/to/save
- Ensure ROS is installed on both the Raspberry Pi and the laptop. This guide assumes you are using ROS Noetic.
- Both devices must be connected to the same network.
On both the Raspberry Pi and the laptop, open a terminal and run:
hostname -I
Note down the IP addresses displayed.
On both devices, you will need to set up the ROS network environment variables in the ~/.bashrc
file.
Add the following lines to ~/.bashrc
:
export ROS_MASTER_URI=http://[Pi_IP_address]:11311
export ROS_HOSTNAME=[Pi_IP_address]
Replace [Pi_IP_address]
with the IP address noted earlier.
Add the following lines to ~/.bashrc
:
export ROS_MASTER_URI=http://[Pi_IP_address]:11311
export ROS_HOSTNAME=[Laptop_IP_address]
Replace [Pi_IP_address]
and [Laptop_IP_address]
with their respective IP addresses.
After modifying ~/.bashrc
, apply the changes by running:
source ~/.bashrc
on both devices.
Ensure that both devices can communicate with each other via the ROS master. On the laptop, you can check if it can see the ROS master by running:
rostopic list
This command should return a list of active ROS topics if the network is configured correctly.
First Update USB Serial Port Names:
- Navigate to the following files:
create_robot/create_bringup/config/default.yaml
rplidar_ros/launch/rplidar_a1.launch
Navigate to the directory containing the pi_launch.launch
file and run:
roslaunch create_navigation pi_launch.launch
Navigate to the directory containing the laptop_launch.launch
file and run:
roslaunch create_navigation laptop_launch.launch
-
Unable to Communicate Between Devices: Check if both devices have the correct IP settings in
~/.bashrc
and are on the same network. Also, ensure there are no firewall settings blocking the necessary ports (especially 11311). -
Commands Not Recognized: Ensure that ROS is properly installed and that you have sourced the setup file in
~/.bashrc
with:or the appropriate path for your ROS installation.source /opt/ros/noetic/setup.bash