Ubuntu 22.04 and ROS2 Humble

Hi,

For using BLMC drivers, I am trying to install ROs2 onto the latest version of Ubuntu 22.04. It seems that ROS2 Foxy on which BLMC is tested, does not work with 22.04, and I will have to use ROS2 Humble. Will the BLMC code worl
With Humble?

Vijay

Hi Vijay,

Which packages do you want to use? Just before the Christmas holidays I gave a quick try to build the TriFinger packages with Ubuntu 22.04/ROS Humble and ran into an error when building the Python bindings. Packages without Python bindings seemed to build without error, though, so depending on what you need it may already work. My suggestion would be to just give it a try.

Regarding the error I got, I hope to find some time in the next days to investigate it but since I currently have some other TODOs with higher priority, I don’t want to promise anything at the moment.

Best,
Felix

Felix,

I simply want to test the single 2 DoF leg using TI Launchpad. I have flashed it with the Dual Motor Torque control and tested the individual motors connected with the pulleys and belts using Debug mode successfully. Since Masterboard and BLMC microboards are not available Ive been using Launchpad, and intend to use CAN to communicate, once I receive the CAN card from PEAK.

  1. I was hoping to use the 2 DoF Leg Test stand v1 and do the jumping gait. I wanted to use GitHub - open-dynamic-robot-initiative/teststand: Drivers for the one leg Teststand robot in MPI-IS.. For that I understand we need to install BLMC drivers package. Is that correct? Alternatively, Is it possible to simply achieve the obective of testing a 2 DoF leg in a jumping gait using a standalone software using CAN?

  2. Since I thought BLMC drivers is required, I installed ROS2 Humble on Ubuntu 22.04, since Foxy doesnt work on this version. I tried to follow the Build instructions using Humble. Build Instructions — blmc_drivers 2.0.0 documentation (open-dynamic-robot-initiative.github.io).
    I managed to clone the BLMC Drivers, but once i start building using ‘colcon build’, I start getting various errors. So I have held off for now. The option is either to degrade to Ubuntu 20 and use Foxy or find a simpler alternative.

Please could you advise the best way of testing the 2 DoF leg in a jumping gait?

Your help would be appreciated since I have been struggling with this.

Thanks,

Vijay

I tried installing BLMC Drivers and this is the message I get:

Starting >>> mpi_cmake_modules
Starting >>> googletest-distribution
Starting >>> pybind11
Finished <<< mpi_cmake_modules [0.11s]                                                                             
Finished <<< googletest-distribution [0.16s]
Starting >>> serialization_utils
Finished <<< serialization_utils [0.12s]                                                    
[Processing: pybind11]                             
[Processing: pybind11]                                      
[Processing: pybind11]                                        
--- stderr: pybind11                                          
In function ‘cast’,
    inlined from ‘operator()’ at /home/vijay/workspace/src/pybind11/include/pybind11/pybind11.h:249:33,
    inlined from ‘_FUN’ at /home/vijay/workspace/src/pybind11/include/pybind11/pybind11.h:224:21:
/home/vijay/workspace/src/pybind11/include/pybind11/detail/../cast.h:653:13: warning: ‘operator delete’ called on unallocated object ‘int_string_pair’ [-Wfree-nonheap-object]
  653 |             delete src;
      |             ^
/home/vijay/workspace/src/pybind11/include/pybind11/detail/../cast.h: In function ‘_FUN’:
/home/vijay/workspace/src/pybind11/tests/test_builtin_casters.cpp:269:40: note: declared here
  269 |     static std::pair<int, std::string> int_string_pair{2, "items"};
      |                                        ^
In function ‘cast’,
    inlined from ‘operator()’ at /home/vijay/workspace/src/pybind11/include/pybind11/pybind11.h:249:33,
    inlined from ‘_FUN’ at /home/vijay/workspace/src/pybind11/include/pybind11/pybind11.h:224:21:
/home/vijay/workspace/src/pybind11/include/pybind11/stl.h:190:5: warning: ‘operator delete’ called on unallocated object ‘lvv’ [-Wfree-nonheap-object]
  190 |     PYBIND11_TYPE_CASTER(Type, const_name("List[") + value_conv::name + const_name("]"));
      |     ^
/home/vijay/workspace/src/pybind11/include/pybind11/stl.h: In function ‘_FUN’:
/home/vijay/workspace/src/pybind11/tests/test_stl.cpp:179: note: declared here
  179 |     static std::vector<RValueCaster> lvv{2};
      | 
---
Finished <<< pybind11 [1min 33s]
Starting >>> real_time_tools
Starting >>> shared_memory
Starting >>> signal_handler
--- stderr: real_time_tools                                                                               
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
/usr/bin/ld: cannot find -ledit: No such file or directory
/usr/bin/ld: cannot find -lcurses: No such file or directory
/usr/bin/ld: cannot find -lglut: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/real_time_tools.dir/build.make:210: libreal_time_tools.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:156: CMakeFiles/real_time_tools.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< real_time_tools [0.35s, exited with code 2]
Aborted  <<< signal_handler [2.65s]                                                                                   
Aborted  <<< shared_memory [6.45s]                                      

Summary: 4 packages finished [1min 40s]
  1 package failed: real_time_tools
  2 packages aborted: shared_memory signal_handler
  4 packages had stderr output: pybind11 real_time_tools shared_memory signal_handler
  2 packages not processed

You will indeed need the blmc_drivers package when using CAN. It provides a low level interface to communicate with the robot via CAN. Depending on what you want to do, this could already be sufficient. I’m afraid the package is not that well documented, but there are a bunch of examples.

I assume the teststand package provides some interface on top of blmc_drivers to make it easier to use but I’m not familiar with this package, so I can’t answer specific questions about it (maybe @mnaveau or @jviereck can).

As an alternative, you could use the robot_fingers package (which is also based on blmc_drivers). It is meant for the TriFinger robots but also implements an interface for a generic two-joint robot, so I think it should be possible to use that for your leg. The two-joint-part is also not really documented (I only implemented it for internal tests) but for this package, I could provide more help if you want to try it (e.g. a basic example script).
Note, however, that this package is affected by the issue I mentioned earlier, so it’s not yet working on 22.04/Humble.

Regarding your build error:

/usr/bin/ld: cannot find -ledit: No such file or directory
/usr/bin/ld: cannot find -lcurses: No such file or directory
/usr/bin/ld: cannot find -lglut: No such file or directory

This suggests that you are just missing some dependencies. I think in this case, the missing packages are libedit-dev, libncurses-dev and freeglut3-dev.


Independent of specific packages:
Instead of down-grading the PC to Ubuntu 20.04, you could also consider using a container. I am using Apptainer/Singularity for the TriFinger project, which allows me to directly run the software on any PC, independent of the Ubuntu version and without need to install all the dependencies locally.
There is some information in the robot_fingers documentation.

1 Like
  1. I have managed to successfully blmc_drivers work on ubuntu 22.04 and ros2 humble. It took a while, and I will put some tips and tricks and some notes later.
  2. the CAN communication is working when I manually send comms signal using the CAN Communications like candump etc.
  3. Its taken me a while to figure out BLMC Drivers and I have been trying to use the demos package and facing some issues.
  4. Demo _1_motor : I put the arguments as can1 0, for the can bus and motor index and the get the following screen - basically the can frames are being shown at different time indexes. Of course, the motor does not move, because the current = 0.

  1. However, it does not run when I use the ros2 run command since I keep getting the message ‘package not found’. I can run it using ‘./ demo_1_motor’, in the src/build/blmc_drivers directory. I have tried using blmc_drivers and demos as the package name, but does not work.

could you help?

Great to hear you had some success :slight_smile:

Did you source the setup.bash of the workspace after building? This is necessary for the packages to be found (and needs to be repeated every time you start a new terminal). I.e. the following sequence should work:

cd path/to/workspace
colcon build
. install/setup.bash
ros2 run blmc_drivers demo_1_motor ...

If you did this and it is still not working, I unfortunately don’t know what could be the problem.

1 Like

Felix, thanks. I had figured it out and it works. Thanks