|
|
(13 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
|
| |
|
| [[File:scorpi_in_profile.png | 600px]] | | Scorpi has its name as it looks a bit like a scorpion and is controlled by Raspberry Pi. |
| | |
| | [[File:scorpi_in_profile.png | 600px | On-shape view of the Scorpi design. | On-shape view of the Scorpi design.]] |
|
| |
|
| ==Overview== | | ==Overview== |
|
| |
|
| [[Motor drive]] firmware | | [[Scorpi modules | Scorpi hardware interface modules]] |
|
| |
|
| [[Motor drive PCB]] with modifications | | [[Motor drive]] firmware. |
| | |
| | [[Motor drive PCB]] and cabling. |
|
| |
|
| [[Teensy interface]] and MQTT interface
| |
|
| |
|
| ==Development nodes== | | ==Development nodes== |
|
| |
|
| === Raspberry pi ===
| | [[Scorpi Pi installation| Raspberry Pi 5 installation]] for Scorpi. |
| | |
| [[Scorpi Pi installation| Raspberry Pi 5 installation]] for Scorpi | |
| | |
| [[YD-Lidar details]]
| |
| | |
| | |
| | |
| ==Ros2 Iron==
| |
| | |
| Installation on Raspberry Pi 5 running
| |
| default 64-bit OS: Debian GNU/Linux 12 (bookworm)
| |
| | |
| === Base===
| |
| Add en_DK.UTF-8 in this list
| |
| $ sudo dpkg-reconfigure locales
| |
| Then run
| |
| $ sudo update-locale LC_ALL=en_DK.UTF-8 LANG=en_DK.UTF-8
| |
| $ export LANG=en_DK.UTF-8
| |
| | |
| Compiled packages are not supported for Raspberry 64-bit OS, so install from source,
| |
| Followed:
| |
| | |
| https://docs.ros.org/en/iron/Installation/Alternatives/Ubuntu-Development-Setup.html
| |
| | |
| The result goes into ~/ros2_iron
| |
| | |
| Note that ''rosdep'' fails in most cases, as the platform is not that much supported.
| |
| Manual dependency updates are therefore used in most cases.
| |
| | |
| Note, this command takes maybe 3 hours to compile all (on Raspberry Pi 5 - (8G memory):
| |
| | |
| cd ~/ros2_iron/
| |
| colcon build --symlink-install
| |
| | |
| Add this line to ~/.bashrc
| |
| source /home/local/ros2_iron/install/setup.bash
| |
| | |
| The examples should now work (in separate terminals)
| |
| ros2 run demo_nodes_cpp talker
| |
| ros2 run demo_nodes_py listener
| |
| | |
| === ROS2 domain ===
| |
| | |
| Ros2 domain over local network
| |
| | |
| $export | grep ROS_
| |
| | |
| could show
| |
| | |
| declare -x ROS_AUTOMATIC_DISCOVERY_RANGE="SUBNET"
| |
| declare -x ROS_DISTRO="iron"
| |
| declare -x ROS_DOMAIN_ID="8"
| |
| declare -x ROS_LOCALHOST_ONLY="0"
| |
| declare -x ROS_PYTHON_VERSION="3"
| |
| declare -x ROS_VERSION="2"
| |
| | |
| In this case, ROS cooperates with others on the local network who also have ROS_DOMAIN_ID="8."
| |
| | |
| If used, insert these into ~/.bashrc
| |
| export ROS_DOMAIN_ID=8
| |
| export ROS_LOCALHOST_ONLY="0"
| |
| | |
| ROS_DOMAIN=0 is the default.
| |
| | |
| ==YDLidar driver==
| |
| | |
| Make a new ROS2 workspace for this application, here called ''scorpi_ws''
| |
| | |
| mkdir -p ~/scorpi/src
| |
| cd scorpi_ws/src
| |
| | |
| Get the modified YDLidar driver (modified for ''iron'')
| |
| | |
| ls
| |
| ydlidar_ros2
| |
| | |
| Modify scorpi_ws/src/ydlidar/params/ydlidar.yaml to the type of YDlidar you use,
| |
| For YDlidar X4 it could look like
| |
| ydlidar_node:
| |
| ros__parameters:
| |
| port: /dev/ttyUSB0
| |
| frame_id: laser_frame
| |
| ignore_array: ""
| |
| baudrate: 128000
| |
| samp_rate: 9
| |
| resolution_fixed: true
| |
| singleChannel: false
| |
| auto_reconnect: true
| |
| reversion: true
| |
| isToFLidar: false
| |
| angle_max: 180.0
| |
| angle_min: -180.0
| |
| max_range: 16.0
| |
| min_range: 0.1
| |
| frequency: 10.0
| |
| | |
| Now build the driver
| |
| | |
| cd ..
| |
| colcon build
| |
| | |
| You should get a few warnings only.
| |
| | |
| With the YDLidar X4 connected test with the driver nodes.
| |
| | |
| cd ~/scorpi_ws
| |
| ros2 run ydlidar ydlidar_node
| |
| | |
| And get something like:
| |
| | |
| [YDLIDAR INFO] Current ROS Driver Version: 1.4.5
| |
| [YDLIDAR INFO] port: /dev/ttyUSB0
| |
| [YDLIDAR INFO] baudrate: 128000
| |
| [YDLIDAR]:SDK Version: 1.4.5
| |
| [YDLIDAR]:Lidar running correctly ! The health status: good
| |
| [YDLIDAR] Connection established in [/dev/ttyUSB0][128000]:
| |
| Firmware version: 1.4
| |
| Hardware version: 1
| |
| Model: X4
| |
| Serial: 2018060400000037
| |
| [YDLIDAR INFO] Current Sampling Rate : 5K
| |
| [YDLIDAR INFO] Now YDLIDAR is scanning ......
| |
| | |
| The node should publish /scan, e.g.:
| |
| | |
| ros2 topic list
| |
| /parameter_events
| |
| /rosout
| |
| /scan
| |
| | |
| == SLAM toolbox ==
| |
| | |
| Fetch the SLAM toolbox from https://github.com/SteveMacenski/slam_toolbox.git
| |
| | |
| cd ~/scorpi_ws/src
| |
| git clone https://github.com/SteveMacenski/slam_toolbox.git
| |
|
| |
| This can not be build right away, as some dependencies are missing
| |
| | |
| sudo apt install libsuitesparse-dev
| |
| sudo apt install libeigen3-dev
| |
| sudo apt install libceres-dev
| |
| sudo apt install libbondcpp-dev
| |
| | |
| cd ~/scorpi_ws
| |
| colcon build
| |
| | |
| Compile failed with:
| |
|
| |
|
| In file included from /home/local/scorpi_ws/src/slam_toolbox/src/slam_toolbox_common.cpp:23:
| | [[MQTT and Mosquitto]]. |
| /home/local/scorpi_ws/src/slam_toolbox/include/slam_toolbox/slam_toolbox_common.hpp:34:10: fatal error: bondcpp/bond.hpp:
| |
| No such file or directory
| |
| 34 | #include "bondcpp/bond.hpp"
| |
|
| |
|
| It seems like bond.hpp is not included in the version of libbondcpp-dev.
| | [[Teensy interface]] installation. |
|
| |
|
| Bond is used by the lifecycle manager - that can be disabled. So, assuming it will run without, I removed all references to bond in
| | [[YD-Lidar details]]. |
| include/slam_toolbox/slam_toolbox_common.hpp
| |
| src/slam_toolbox_common.cpp
| |
| Two include files, one pointer in the hpp file, two functions and two calls to these functions in the cpp file.
| |
|
| |
|
| Then the package compiled OK.
| | [[Scorpi Ros Iron]] (outdated). |