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?
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.
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.
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?
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.
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.
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.
the CAN communication is working when I manually send comms signal using the CAN Communications like candump etc.
Its taken me a while to figure out BLMC Drivers and I have been trying to use the demos package and facing some issues.
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.
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.
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.