Micro XRCE DDS Agent Build for Raspberry Pi
From wikidb
Contents
References
- Build and Install Micro-XRCE-DDS Robotis Instructions for Raspberry Pi. Don't work for Ubuntu 18.04 install.
- MicroXRCEAgenet Build and Install fails with missing TINY2_SOURCE_DIR in cmake Problem ticket
Impact
The Raspberry Pi Instructions didn't work for Ubuntu 18.04. Eventually abandoned.
Build and Install Micro-XRCE-DDS
$ cd
$ git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git Cloning into 'Micro-XRCE-DDS-Agent'... remote: Enumerating objects: 168, done. remote: Counting objects: 100% (168/168), done. remote: Compressing objects: 100% (68/68), done. remote: Total 7098 (delta 104), reused 128 (delta 76), pack-reused 6930 Receiving objects: 100% (7098/7098), 1.79 MiB | 8.83 MiB/s, done. Resolving deltas: 100% (4071/4071), done.
$ cd Micro-XRCE-DDS-Agent
$ ls agent.refs Dockerfile microxrce_agent.cpp thirdparty cmake docs README.md utils CMakeLists.txt include src valgrind.supp CTestJenkins.cmake LICENSE test
$ git checkout a495c65faa964ddc068ac6e1249f17f5c9f92787 Note: checking out 'a495c65faa964ddc068ac6e1249f17f5c9f92787'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at a495c65 Merge pull request #54 from eProsima/feature/baudrate
$ mkdir build
$ cd build
$ cmake -DTHIRDPARTY=ON -DCONFIG_UDP_TRANSPORT_MTU=8192 -DCONFIG_SERIAL_TRANSPORT_MTU=8192 .. -- Setting build type to 'Release' as none was specified. -- The C compiler identification is GNU 7.4.0 -- The CXX compiler identification is GNU 7.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- fastcdr library found... -- Could NOT find tinyxml2 (missing: TINYXML2_SOURCE_DIR) -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1") -- fastrtps library found... Submodule 'thirdparty/asio' (https://github.com/chriskohlhoff/asio.git) registered for path 'thirdparty/asio' Cloning into '/home/eepp/Micro-XRCE-DDS-Agent/thirdparty/asio'... Submodule path 'thirdparty/asio': checked out '230c0d2ae035c5ce1292233fcab03cea0d341264' -- Found Asio: /home/eepp/Micro-XRCE-DDS-Agent/thirdparty/asio/asio/include -- Configuring done -- Generating done -- Build files have been written to: /home/eepp/Micro-XRCE-DDS-Agent/build
NOTE: "Could NOT find tinyxml2 (missing: TINYXML2_SOURCE_DIR)"
CMakeLists.txt
Hood TB3 Micro XRCE DDS Agent CMakeLists.txt
Failed Mitigations
Install libtinyxml2-dev
References
Install
$ sudo apt install libtinyxml2-dev [sudo] password for eepp: Reading package lists... Done Building dependency tree Reading state information... Done libtinyxml2-dev is already the newest version (6.0.0+dfsg-1). libtinyxml2-dev set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 237 not upgraded.
Impact
none
Other Tiny XML packages
Search tinyxml
$ apt search tinyxml Sorting... Done Full Text Search... Done libtinyxml-dev/bionic,now 2.6.2-4 amd64 [installed,automatic] TinyXml library - header and static library libtinyxml-doc/bionic,bionic 2.6.2-4 all TinyXml library - documentation files libtinyxml2-6/bionic,now 6.0.0+dfsg-1 amd64 [installed,automatic] C++ XML parsing library libtinyxml2-dev/bionic,now 6.0.0+dfsg-1 amd64 [installed] TinyXML2 library - header and static library libtinyxml2.6.2v5/bionic,now 2.6.2-4 amd64 [installed,automatic] C++ XML parsing library libtinyxml2.6.2v5-dbg/bionic 2.6.2-4 amd64 TinyXml library - debug files ros-bouncy-tinyxml-vendor/bionic 0.5.0-0bionic.20180719.222940 amd64 CMake shim over the tinxml library. ros-bouncy-tinyxml2-vendor/bionic 0.4.0-0bionic.20180719.222937 amd64 Wrapper around tinyxml2, providing nothing but a dependency on tinyxml2, on some systems. ros-cmake-modules/bionic,bionic 0.4.1-1 all Robot OS CMake Modules ros-crystal-tinyxml-vendor/bionic,now 0.5.0-0bionic.20190310.045116 amd64 [installed,automatic] CMake shim over the tinxml library. ros-crystal-tinyxml2-vendor/bionic,now 0.6.1-0bionic.20190310.045115 amd64 [installed,automatic] Wrapper around tinyxml2, providing nothing but a dependency on tinyxml2, on some systems. ros-dashing-tinyxml-vendor/bionic,now 0.7.0-1bionic.20190530.060307 amd64 [installed,automatic] CMake shim over the tinxml library. ros-dashing-tinyxml2-vendor/bionic,now 0.6.1-1bionic.20190530.060238 amd64 [installed,automatic] Wrapper around tinyxml2, providing nothing but a dependency on tinyxml2, on some systems.
Try Additional install
NOTE: These were not install. See if installing them helps.
$ sudo apt install ros-cmake-modules $ sudo apt install ros-bouncy-tinyxml-vendor $ sudo apt install ros-bouncy-tinyxml2-vendor
Rebuild
$ cd
$ mv Micro-XRCE-DDS-Agent Micro-XRCE-DDS-Agent-20190725
$ sudo apt update Hit:1 http://packages.ros.org/ros2/ubuntu bionic InRelease Hit:2 http://packages.osrfoundation.org/gazebo/ubuntu bionic InRelease Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:6 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Fetched 252 kB in 1s (298 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done 237 packages can be upgraded. Run 'apt list --upgradable' to see them.
Repeat the above Micro-XRCE-DDS build
Impact
none
Try Crystal MicroXRCEAgent
Desperate - should not work
Install
$ sudo apt install ros-crystal-micro-xrce-dds-agent Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: ros-crystal-micro-xrce-dds-agent 0 upgraded, 1 newly installed, 0 to remove and 237 not upgraded. Need to get 223 kB of archives. After this operation, 1,287 kB of additional disk space will be used. Get:1 http://packages.ros.org/ros2/ubuntu bionic/main amd64 ros-crystal-micro-xrce-dds-agent amd64 1.0.3-1bionic.20190424.130422 [223 kB] Fetched 223 kB in 0s (448 kB/s) Selecting previously unselected package ros-crystal-micro-xrce-dds-agent. (Reading database ... 258463 files and directories currently installed.) Preparing to unpack .../ros-crystal-micro-xrce-dds-agent_1.0.3-1bionic.20190424.130422_amd64.deb ... Unpacking ros-crystal-micro-xrce-dds-agent (1.0.3-1bionic.20190424.130422) ... Setting up ros-crystal-micro-xrce-dds-agent (1.0.3-1bionic.20190424.130422) ... Processing triggers for libc-bin (2.27-3ubuntu1) ...
Explore the Install
$ dpkg -L ros-crystal-micro-xrce-dds-agent /. /opt /opt/ros /opt/ros/crystal /opt/ros/crystal/bin /opt/ros/crystal/bin/MicroXRCEAgent /opt/ros/crystal/include /opt/ros/crystal/include/uxr /opt/ros/crystal/include/uxr/agent ... ... opt/ros/crystal/share/microxrcedds_agent/cmake/microxrcedds_agentTargets.cmake /usr /usr/share /usr/share/doc /usr/share/doc/ros-crystal-micro-xrce-dds-agent /usr/share/doc/ros-crystal-micro-xrce-dds-agent/changelog.Debian.gz /opt/ros/crystal/lib/libmicroxrcedds_agent.so /opt/ros/crystal/lib/libmicroxrcedds_agent.so.1
- NOTE: MicroXRCEAgent in crystal bin directory
- NOTE: libmicroxrcedds_agent.so in crystal lib directory
Add Library to Path and execute =
NOTE: This is a little scary because the is a real possibility of messing things up with paths to Dashing and Crystal libraries. The Dashing libraries are found first which might save us.
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/crystal/lib
plug in OpenCR
$ ll /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Jul 25 15:21 /dev/ttyACM0
$ sudo chmod 666 /dev/ttyACM0 [sudo] password for eepp:
$ ll /dev/ttyACM0 crw-rw-rw- 1 root dialout 166, 0 Jul 25 15:21 /dev/ttyACM0
$ /opt/ros/crystal/bin/MicroXRCEAgent serial /dev/ttyACM0 Error: Invalid arguments. Usage: program <command> List of commands: --serial <device-name> [--baudrate <baudrate>] [--refs <refs-file>] --pseudo-serial [--baudrate <baudrate>] [--refs <refs-file>] --udp <local-port> [--discovery <discovery-port>] [--refs <refs-file>] --tcp <local-port> [--discovery <discovery-port>] [--refs <refs-file>] Segmentation fault (core dumped)
Impact
See: Segmentation fault (core dumped) is a better impact then expected. I'm not going any deeper. There are probably library mismatches that I don't want to explore.
tmp
1
$ echo $PATH /home/eepp/turtlebot3_ws/install/cartographer/bin:/home/eepp/turtlebot3_ws/install/behaviortree_cpp/bin:/opt/ros/dashing/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ apt search libtinyxml2-dev Sorting... Done Full Text Search... Done libtinyxml2-dev/bionic,now 6.0.0+dfsg-1 amd64 [installed] TinyXML2 library - header and static library
$ ls ~/turtlebot3_ws/src/navigation2/BehaviorTree.CPP/3rdparty/tinyXML2/ tinyxml2.cpp tinyxml2.h $ ls /usr/include/tin* /usr/include/tinyxml2.h /usr/include/tinyxml.h
abbreviated steps
$ git clone https://github.com/eProsima/Micro-XRCE-DDS-Agent.git Cloning into 'Micro-XRCE-DDS-Agent'... remote: Enumerating objects: 171, done. remote: Counting objects: 100% (171/171), done. remote: Compressing objects: 100% (71/71), done. remote: Total 7101 (delta 106), reused 129 (delta 76), pack-reused 6930 Receiving objects: 100% (7101/7101), 1.79 MiB | 5.15 MiB/s, done. Resolving deltas: 100% (4073/4073), done.
$ cd Micro-XRCE-DDS-Agent
$ mkdir build && cd build
$ cmake .. -- Could NOT find tinyxml2 (missing: TINYXML2_LIBRARY) -- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1") -- Configuring done -- Generating done -- Build files have been written to: /home/eepp/Micro-XRCE-DDS-Agent/build
libs
eepp@hood:build$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/
eepp@hood:build$ cmake .. -- Could NOT find tinyxml2 (missing: TINYXML2_LIBRARY) -- Configuring done -- Generating done -- Build files have been written to: /home/eepp/Micro-XRCE-DDS-Agent/build