基于 ROS 2 的机器人学习平台
ROS 2 based robot learning platform. Click the image to video showing robot design and navigation in action
The BOM has not been designed for easy replication but most all used components and alternatives considered are there with respective links of where were they purchased so maybe it helps someone putting together a similar build :) Click the image to open BOM
Disclaimer
The following documentation is various commands and information that I've written over the time the robot was in development and everything is not up to date or relevant but maybe it helps someone.
sudo usermod -a -G input ubuntusudo usermod -a -G dialout ubuntusudo usermod -a -G tty ubuntucd ~/rosbot/ros to open workspacerosdep install -i --from-path src --rosdistro foxy -y to install dependenciesgit pull && colcon build to pull changes and build workspacecd ~/rosbot/ros to open workspace. install/local_setup.bash to load workspace overlay (on both robot and remote pc)ros2 launch odrive_bringup rosbot.launch.py to launch rosbot (run on robot)ros2 launch odrive_bringup rviz.launch.py to launch rviz (run on remote pc). install/local_setup.bash to load workspace overlayros2 launch teleop_twist_joy teleop.launch.py joy_config:='rosbot_xbox_bluetooth' cmd_vel:=/diff_drive_controller/cmd_vel_unstamped to launch joystick teleop. install/local_setup.bash to load workspace overlayros2 launch odrive_bringup odrive.launch.py to launch odrive test ()ros2 topic pub -r 100 /left_wheel_joint_velocity_controller/commands std_msgs/Float64MultiArray "data: [1]"ros2 topic pub -r 100 /right_wheel_joint_velocity_controller/commands std_msgs/Float64MultiArray "data: [-1]"ros2 launch teleop_twist_joy teleop.launch.py joy_config:='rosbot_xbox_bluetooth' cmd_vel:=/diff_drive_controller/cmd_vel_unstamped to launch joystick teleop/cmd_velros2 launch teleop_twist_joy teleop.launch.py cmd_vel:=cmd_vel joy_config:=rosbot_xbox_usbros2 topic echo /joint_states to show joint states including velocity etcros2 topic echo /dynamic_joint_states to show dynamic joint states including axis error etcros2 run tf2_tools view_frames.py to generate frames.pdf frame treerqt to open RQT, add plugins such as Topics > Topic Monitorros2 run xacro xacro ./src/rosbot_description/urdf/rosbot.urdf.xacro to debug what's wrong with URDF fileros2 run tf2_ros tf2_echo odom base_link to verify transforms from odom to base_linksudo apt install cabextract to install dependenciesgit clone https://github.com/medusalix/xowcd xowmake BUILD=RELEASEsudo make installsudo systemctl enable xowsudo systemctl start xowsudo systemctl kill -s SIGUSR1 xow to enable XOW pairing mode (generally not needed)sudoedit /sys/module/bluetooth/parameters/disable_ertmN with Ysudo service bluetooth restartsudo rmmod btusbjstest /dev/input/js0sudo apt install dkms git linux-headers-uname -r``git clone https://github.com/atar-axis/xpadneo.gitcd xpadneosudo ./install.shsudoedit /boot/firmware/usrcfg.txtdtoverlay=disable-bluetoothhciconfig -a and hcitool devsudo apt install bluez pi-bluetooth joysticksudoedit /boot/firmware/usrcfg.txthciconfig -a or hcitool dev (from bluez) to check for bluetooth devicesbluetoothctl to run interactive bluetooth controllerscan ontrust XX:XX:XX:XX:XX:XX to trust the controllerconnect XX:XX:XX:XX:XX:XX to connect to the controllersudo chmod a+rw /dev/input/js0 to give everyone read-write permissions to joysticksudo chmod a+rw /dev/input/event4 to give everyone read-write permissions to joystick (sometimes it's one of eventX)/dev/input/eventX does not have correct permissions then (this does not seem to actually work)sudo apt install input-utils to install lsinput toolsudo lsinput to get list of inputs, note the vendor and product of "Xbox Wireless Controller"sudoedit 80-xbox-controller.rulesKERNEL=="event*", ATTRS{idProduct}=="02e0", ATTRS{idVendor}=="045e", MODE="0666" etc that mathes vendor and productsudo apt install joystickjstest /dev/input/js0ros2 run joy joy_enumerate_devicessudo apt install jstest-gtkjstest-gtkros2 topic echo /joyros2 topic echo /cmd_velros2 topic echo /diff_drive_controller/cmd_vel_unstampedsudo apt install ros-foxy-gazebo-ros-pkgscd /boot/firmwaresudo cp usrcfg.txt usrconfig.backup.txtsudo cp cmdline.txt cmdline.backup.txtenable_uart=0 to /boot/firmware/usrcfg.txtconsole=serial0,115200 from /boot/firmware/cmdline.txtsudo systemctl stop [email protected]sudo systemctl disable [email protected]sudo systemctl mask [email protected]sudo apt install ros-foxy-navigation2 ros-foxy-nav2-bringup ros-foxy-cartographer ros-foxy-cartographer-ros ros-foxy-robot-localization ros-foxy-slam-toolbox ros-foxy-gazebo-ros-pkgs ros-foxy-xacro ros-foxy-slam-toolboxsudo apt install ros-foxy-turtlebot3* for testing on remote pc onlyslam-toolboxros2 launch slam_toolbox online_async_launch.py to launch slam toolbox mapperros2 launch nav2_bringup navigation_launch.py to run navigation2https://github.com/ros-planning/navigation2_tutorials.gitros2 launch sam_bot_description display.launch.pycd ~/rosbot/ros. install/local_setup.bashros2 launch teleop_twist_joy teleop.launch.py cmd_vel:=/demo/cmd_vel joy_config:=rosbot_xbox_usbros2 launch slam_toolbox online_async_launch.pyhttps://www.adafruit.com/package_adafruit_index.json to Arduino preferences additional boards URLsAdafruit nRF52pip3 install --user adafruit-nrfutilgit clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.gitcd Micro-XRCE-DDS-Agent && git checkout foxymkdir build && cd buildsource /opt/ros/dashing/setup.bash # to share libraries with ros2cmake ..makesudo make installsudo ldconfig /usr/local/lib/cmake --versionsudo apt updatesudo apt install -y software-properties-common lsb-releasewget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/nullsudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"sudo apt updatesudo apt install kitware-archive-keyringsudo rm /etc/apt/trusted.gpg.d/kitware.gpgsudo apt updatesudo apt install cmakecmake --versionpip3 install catkin_pkg lark-parser empy colcon-common-extensions mbed-toolssudo apt install gcc-arm-none-eabimbed-tools deploymbed-tools compile -m LPC1768 -t GCC_ARM -fsudo apt install software-properties-commonsudo add-apt-repository universesudo apt update && sudo apt install curl gnupg2 lsb-releasesudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpgecho "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/nullsudo apt updatesudo apt install ros-foxy-desktopsudo apt install -y python3-argcompleteecho "source /opt/ros/foxy/setup.bash" >> ~/.bashrcecho "source /usr/share/colcon_cd/function/colcon_cd.sh" >> ~/.bashrcecho "export _colcon_cd_root=~/ros2_install" >> ~/.bashrcprintenv | grep -i ROSecho "export ROS_DOMAIN_ID=" >> ~/.bashrcros2 run demo_nodes_cpp talkerros2 run demo_nodes_py listenersudo apt-get install ros-galactic-ros2bag ros-galactic-rosbag2-storage-default-pluginssudo snap install --classic codesudo apt install ros-foxy-turtlesim暂无开放 Issues,或尚未同步最近议题。