Create a workpace
mkdir -p project3_ws/src
cd ~/project3_ws/src
Clone the reposiory
git clone https://github.com/shantanuparabumd/turtlebot3_project3.git
Source ROS (Enable ROS commands)
source /opt/ros/galactic/setup.bash
Build the workspace
cd ~\project3_ws
colcon build --packages-select turtlebot3_project3
Source ROS (Package will be identified)
source install/setup.bash
Launch Environment
ros2 launch turtlebot3_project3 competition_world.launch
Explore Topics
ros2 topic list
Publish to topic (cmd_vel)
ros2 topic pub \cmd_vel geometry_msgs/msg/Twist "linear:
x: 0.1
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.1"
We have provide a script fro reference in teleop.py
You can run the script using
ros2 run turtlebot3_project3 teleop.py
- Write a new python script and store it in a folder
- Update the CMakeLists.txt file
# Install python scripts
install(PROGRAMS
scripts/teleop.py
# You can add more scripts here
DESTINATION lib/${PROJECT_NAME}
)
- Build the package
- Source the install folder
- Run the executable
ros2 run turtlebot3_project3 teleop.py
- Pynput Module Not Found
pip install pynput