Skip to content

TUM-AVS/z1_ros2

 
 

Repository files navigation

Unitree Z1 ROS2 package

This is a community-driven package that enable the Z1 Manipulator from Unitree to work in ROS2.

Humble CI Jazzy CI Rolling CI

Quick Start

To use this package in ROS2, first clone this repository in a ROS2 workspace, e.g.:

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/idra-lab/z1_ros2.git

All external dependencies can be installed with rosdep:

rosdep update
rosdep install --from-paths ~/ros2_ws/src --ignore-src

Make sure that you sourced the ROS2 global workspace (source /opt/ros/humble/setup.bash) and then simply build the workspace as:

cd ~/ros2_ws
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

Finally, make sure to source also the built workspace (source ~/ros2_ws/install/setup.bash).

ROS2 packages

This repository contains different sub-packages:

For more information for each package, please refer to the corresponding README.

Robot in action

To get started with the Z1 manipulator in the simulation environment, you may call

ros2 launch z1_bringup z1.launch.py starting_controller:=joint_trajectory_controller

This make sure to launch the robot with the joint_trajectory_controller, which provide a simple motion planning facility.

To test the proper functionality, we can use the waypoint_test.py script to send a default plan as follows:

ros2 run z1_examples waypoint_test.py

The outcome of the simulation shall be the following:

By using the same bringup launch file, it becomes really easy to transition from the simulation environment to the connection with the real robot. It is necessary to launch

ros2 launch z1_bringup z1.launch.py starting_controller:=joint_trajectory_controller sim_ignition:=false

alongside with the waypoint_test.py executable, and the hardware interface which connects to the real robot is loaded over the simulator interface, and the robot performs the same motion.

Note: this example uses the position command interface for the robot (as specified in the configuration file for the joint_trajectory_controller), and you may have some trouble replicating the simulation on your machine. As mentioned in this issue, a temporary fix is to delete all appearences of the effort command interface from the z1.ros2_control.xacro. Note that this is a problem of the ROS2 control plugin for Ignition, and not some misconfiguration of this package; the connection with the hardware does not suffer this problem. A better fix to deleting parts from the URDF is planned but not implemented yet.

Contributing

Everyone is welcome to contribute to this repository.

If you want to improve something, or have some particular request, please first open an issue to disclose your idea with everyone.

As general rule, please develop your feature/bug-fix on a new branch, and create a pull request targeting the development branch (devel). There we will make sure that the change is working as expected, and will update the reference of the main branch accordingly, to guarantee the stability of such branch.

About

ROS2 package for the Z1 manipulator from Unitree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 45.3%
  • C++ 42.3%
  • CMake 12.4%