locale
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
sudo apt update && sudo apt install curl gnupg2 lsb-release
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 $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt install ros-foxy-desktop ros-foxy-rmw-fastrtps ros-foxy-rmw-cyclonedds
echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc
source ~/.bashrc
[Test]
ros2 run demo_nodes_cpp talker
ros2 run demo_nodes_py listener
sudo apt update && sudo apt install -y build-essential cmake git libbullet-dev python3-colcon-common-extensions python3-flake8 python3-pip python3-pytest-cov python3-rosdep python3-setuptools python3-vcstool wget
python3 -m pip install -U argcomplete flake8-blind-except flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes pytest-repeat pytest-rerunfailures pytest
sudo apt install --no-install-recommends -y libasio-dev libtinyxml2-dev libcunit1-dev
mkdir -p ~/ros2_ws/src
colcon build --symlink-install
echo "source ~/ros2_ws/install/local_setup.bash" >> ~/.bashrc
echo "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrc
echo "export _colcon_cd_root=/opt/ros/foxy/" >> ~/.bashrc
echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> ~/.bashrc
echo "source /usr/share/vcstool-completion/vcs.bash" >> ~/.bashrc
echo "export RMW_IMPLEMENTATION=rmw_fastrtps_cpp" >> ~/.bashrc
echo "# export RMW_IMPLEMENTATION=rmw_connext_cpp" >> ~/.bashrc
echo "# export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc
echo "# export RMW_IMPLEMENTATION=rmw_gurumdds_cpp" >> ~/.bashrc
echo "export ROS_DOMAIN_ID=5" >> ~/.bashrc
echo "export ROS_NAMESPACE=robot5" >> ~/.bashrc
echo "# export RCUTILS_CONSOLE_OUTPUT_FORMAT='[{severity} {time}][{name}]: {message} ({function_name}() at {file_name}:{line_number})'" >> ~/.bashrc
echo "export RCUTILS_CONSOLE_OUTPUT_FORMAT='[{severity}]: {message}'" >> ~/.bashrc
echo "export RCUTILS_COLORIZED_OUTPUT=1" >> ~/.bashrc
echo "export RCUTILS_LOGGING_USE_STDOUT=0" >> ~/.bashrc
echo "export RCUTILS_LOGGING_BUFFERED_STREAM=1" >> ~/.bashrc
echo "alias cw='cd ~/robot_ws'" >> ~/.bashrc
echo "alias cs='cd ~/robot_ws/src'" >> ~/.bashrc
echo "alias ccd='colcon_cd'" >> ~/.bashrc
echo "alias cb='cd ~/robot_ws && colcon build --symlink-install'" >> ~/.bashrc
echo "alias cbs='colcon build --symlink-install'" >> ~/.bashrc
echo "alias cbp='colcon build --symlink-install --packages-select'" >> ~/.bashrc
echo "alias cbu='colcon build --symlink-install --packages-up-to'" >> ~/.bashrc
echo "alias ct='colcon test'" >> ~/.bashrc
echo "alias ctp='colcon test --packages-select'" >> ~/.bashrc
echo "alias ctr='colcon test-result'" >> ~/.bashrc
echo "alias rt='ros2 topic list'" >> ~/.bashrc
echo "alias re='ros2 topic echo'" >> ~/.bashrc
echo "alias rn='ros2 node list'" >> ~/.bashrc
echo "alias killgazebo='killall -9 gazebo & killall -9 gzserver & killall -9 gzclient'" >> ~/.bashrc
echo "alias af='ament_flake8'" >> ~/.bashrc
echo "alias ac='ament_cpplint'" >> ~/.bashrc
echo "alias testpub='ros2 run demo_nodes_cpp talker'" >> ~/.bashrc
echo "alias testsub='ros2 run demo_nodes_cpp listener'" >> ~/.bashrc
echo "alias testpubimg='ros2 run image_tools cam2image'" >> ~/.bashrc
echo "alias testsubimg='ros2 run image_tools showimage'" >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-rosdep2 -y
rosdep update