This project involves the development of an basic obstacle avoidance algorithm for turtlebot3 robot.
- System configuration: Ubuntu 22.04
- ROS2 Humble should be installed, if not you can follow the instructions below
- ament_cmake
- rclcpp
- std_msgs
Installing ROS2 Humble for Ubuntu 22.04 (http://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)
You should follow the link for more updated instructions
locale # check for UTF-8
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale # verify settings
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt upgrade
sudo apt install ros-humble-desktop
sudo apt install ros-humble-ros-base
sudo apt install ros-dev-tools
Source the setup file to start ROS2, add the following line in the .bashrc file of your system:
source /opt/ros/humble/setup.bash
sudo apt install clang
export CC=clang
export CXX=clang++
colcon build --cmake-force-configure
sudo apt install ros-humble-turtlebot3*
sudo apt install ros-humble-gazebo-ros-pkgs
cd ~/ros2_ws/src
git clone https://github.com/sanchit2843/ObstacleAvoider
colcon build --packages-select ObstacleAvoider
. install/setup.bash
ros2 launch ObstacleAvoider obstacle_avoider_launch.py
ros2 launch ObstacleAvoider obstacle_avoider_launch.py record_topics:=True
ros2 bag info tb3_walker_bag/
cpplint --filter=-build/c++11,+build/c++17,-build/namespaces,-build/include_order src/*.cpp &> ../results/cpplint.txt
cppcheck --enable=all --std=c++17 src/*.cpp --suppress=missingIncludeSystem --suppress=missingInclude --suppress=unmatchedSuppression > ../results/cppcheck.txt