[Unitree A1] Installing ROS and qre driver

Please source your directory via, replace the your_username with your PC’s name.

source /home/your_username/catkin_ws/devel/setup.bash

To add it permanently to your PC.

cd
nano .bashrc

Add the same line to the end of your .bashrc file

source /home/your_username/catkin_ws/devel/setup.bash

I have sourced it manually and added it to the .bashrc file, but it is still getting the same error.

Also if I search through my catkin_ws there is no launch file with the name high_level_mode.

Is there anything I missed or is there anything I did not install/compile?

Hi @Martin

I think you are using the driver version 3.3.1. For that actually, we have updated the source code to work with unitree_legged_sdk.

Apologies, as our documentation is still a working progress.

You have to run the following command:

roslaunch qre_a1 base.launch

Please bear in mind that the robot needs to be in sports mode to be working in high-level mode.

Hi Sohail, hi Tahir,

no worries! Thank you for your fast responses!

Can you help me establish a connection to the robot itself?

I am working with a virtual machine and want (at first) to have the driver installed on the VM, regardless the latencies as Sohail described in his first answer.

I am able to connect to the robot over wifi and ssh, but how do I send it ROS commands from my computer?

Regards

Martin

I just reread this thread, which is somewhat the same issue I am working on, I guess.

The reason I am trying to use a remote VM is because we are planning on giving the robot to some of our student and therefore we do not want to install everything on the Nvidia or Pi. We want to give our students the possibilty of an isolated system on their own computer and to avoid having the on-board pcs full of unneccesary files/programs.

For our case, we have the Nvidia and the remote pc. The rosmaster will presumably run on the nvidia and therefore it will be neccessary to setup the ROS network and we will be running ROS on multiple machines.

Is this type of communication possible for the A1 here?

Does the A1 need a ROS master for communication? Because I did not factor in the LCM protocol.
If so, where would be the best option to start the master (nvidiva or remote pc)?

I would really appreciate if you could share your experience!

Best regards

Martin

Hi,

The ROS driver communicates with the A1 through the LCM. So even if there are no ROS or ROS packages on the A1. You can control it fully by running ROS on your system (no need for a multi-machine system) as the ROS commands are translated into LCM commands that are forwarded to the A1.

Our recommendation is that the students build and set up their own PCs with the A1 ROS package, connect to the A1 via WiFi or LAN and then through their own PC’s native ROS environment control the robot. The instructions should be in the quadruped docs. If you have any trouble you can continue to ask questions in the forum.

Regards,

S. O. Sohail

Hi,

thanks for the clarification.

Nevertheless, I followed everything exactly as stated in the quadruped docs.
Using Ubuntu 18.04 with ros-melodic, installing LCM and Unitree_legged_sdk_3.2, running the qre_a1.bash file but it still does not work.
If I run with ‘sudo su’, ROS can’t be sourced nor found. If I run without it, I get the error

[base_node-2] process has died [pid 2090, exit code 254, cmd /home/ros/catkin_ws/devel/lib/a1_base/base_node high_level __name:=base_node __log:=/home/ros/.ros/losc63f6cf2-965-11ed-bb36-080027cded3f/base_node-2.log].
log file: /home/ros/.ros/log/c63f6cf2-965b-11ed-bb36-080027cded3f/base_node-2*.log 

If I install everything with only the SDK without the qre_driver, there is a similar issue that a lcm nodes dies because it needs a real time kernel to work.

Can you help me out here, I tried following your docs and the unitree sdk instructions multiple times but can’t get it to work.

Regards and appreciating your help

Martin

Hi,

After you run sudo su you have to source the environment via source /home/<your_pc_username>/<your_workspace_name>/devel/setup.bash

so for example

sudo su
source /home/nx/qre_ws/devel/setup.bash
roslaunch a1_base base.launch 

The launch file will be according to the package you have as we have different versions.

Hi Sohail,

I tried it exactly the way you described. This is the output:

Any guesses why the node has died?

Regards

Martin

Hi @Martin!

As the error states, the liblcm.so file can’t be opened, since it seems to be missing.
I don’t have access to the code of the a1 qre to dig a little bit deeper bit I’d guess you have to install the lcm package and adjust the path to the shared library.

If lcm is already installed, you can obviously skip the installation and just adjust the path.

This should be everything to install lcm, but I’m not sure about the dependencies:

wget https://github.com/lcm-proj/lcm/releases/download/v1.4.0/lcm-1.4.0.zip
unzip lcm-1.4.0.zip
mv lcm-1.4.0
rm lcm-1.4.0.zip
cd lcm
mkdir build
cd build
cmake ../
make
make install

Thanks for the answers!

I got the node running but I encountered the next problem:

there is no subscriber connecting to the /cmd_vel topic. Therefore I conclude that the robot is not able to connect to the topic.

In the original unitree sdk they set the ip of the external computer to 192.168.123.162, but whenever I set my ip to this address I cannot even ping the robot anymore.

How would it be possible to have the robot subscribe to the topic/to the external computer?

Regards
Martin

Hi, Martin. I have a question about your robot. Is there an Nvidia Jetson Xavier in your robot? If there is, then I have a few questions for you. Can you please send iso/image of your jetson and a photo with the location of the parts inside the robot. I’m wondering exactly where the video card is in it.

Guys, if you have Unitree A1. Then I’m interested in whether there is an Nvidia Jetson Xavier in your robot? If so, I have a few questions for you. Can you please send iso/image of your jetson and a photo with the location of the parts inside the robot? I’m wondering exactly where the graphics card is in it.

@Martin could you do a rosnode info /base_node ?
That should show a list of the topics the node subscribes and publishes on.

About your second question: To connect another computer, you have to have ROS installed and have it on the same network. Then you set the ROS_MASTER_URI of the connecting computer as the IP address of the computer running the roscore. After that, you should be able to send ROS messages between the two.

Hey @MrBasten !
I think it would be best to open your question as a separate topic to not mix up the discussions :slight_smile:

Edit:
NVM, you already did here as I see

Hi Martin,

Only the base driver has to be run with super user: su. For teleop you don’t neet to run with su. As for the /cmd_vel, please run

rostopic list

There will be a topic named /a1/cmd_vel or /qre/cmd_vel. This topic will be used to control the robot via:

rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=/qre/cmd_vel

Hi Sohail, hi jgrube,

thanks for your replies.

@jgrube on the top right there is the rosnode info. It points to the /base_node, which is running on the same system.

@Sohail now the command displays the walking methods, but the robot is not moving. Neither in normal or sport mode it is not walking with the teleop keys. Can you also help me out here, please?

As stated in the docs of the A1 driver, the driver can be installed on a remote system, correct?
So the rosmaster ist running on my remote system and should establish a connection to the 192.168.123.10 board. Wouldn’t it be better to run the rosmaster on the nvidia and connect from the remote system to it with the ROS_MASTER_URI?

Hi @Martin,

Please press start in the remote to put the A1 in movement mode.

As mentioned before, you do not need ros multi-machine. You can revert the ros network changes to the local host settings. The ROS uses LCM to communicate with the A1.

As stated in the docs of the A1 driver, the driver can be installed on a remote system, correct?
So the rosmaster ist running on my remote system and should establish a connection to the 192.168.123.10 board. Wouldn’t it be better to run the rosmaster on the nvidia and connect from the remote system to it with the ROS_MASTER_URI ?

Some of the A1 models have their own native ROS systems, we suggest to use on a remote system to avoid disrupting their system, but you can always do it if you want. Removing their ROS system should disrupt any functionality of the A1.

Hi @Sohail,

although pressing Start on the remote controller and being in sport mode as Tahir mentioned, the robot does not react to the keyboard commands from teleop.
I reverted all network changes and I did not change anything on the nx nor do I plan on removing the native ROS system. It was an idea to have the node/master running on the nx system and the teleop command from the remote system.

Do you have any guesses why the robot would not react to the commands from the remote system?

If it helps, we also have an early version of the A1. Same as here.

I also tried working with the qre_a1 driver version 3.2.0, but with this version I could not invoke the roslaunch qre_a1 base.launch nor could i launch any other package with this version.

Could you please tell me more about the compatibility with the unitree sdk 3.2 and ros_to_real 3.2.1?