qiayuanl / cheetah_ros

ros-control interface and basic controllers for quadruped robot
42 stars 12 forks source link

This repo is archived. For the latest work about legged robot control, please refer to the legged_control.

cheetah_ros

Overview

ROS and ros-control interface and some controllers for quadruped robots.

Keywords: example, package, template

License

The source code is released under a BSD 3-Clause license.

Author: QiayuanLiao
Maintainer: QiayuanLiao, liaoqiayuan@gmail.com

The unitree_ros package has been tested under ROS Noetic on respectively Ubuntu 20.04. This is research code, expect that it changes often and any fitness for a particular purpose is disclaimed.

Installation

Building from Source

Dependencies

Install all dependence in one command:

sudo rosdep install --from-paths src

Building

To build from source, clone the latest version from this repository into your catkin workspace and compile the package using

cd catkin_workspace/src
git clone git@github.com:qiayuanliao/unitree_ros.git
cd ../
rosdep install --from-paths . --ignore-src
catkin build # or catkin_make

Usage

Quick start

Set your robot type(a1 or aliengo) as an environment variable: ROBOT_TYPE

export ROBOT_TYPE=aliengo #export ROBOT_TYPE=a1

Launch the simulation by:

mon launch unitree_gazebo empty_world.launch hung_up:=true

Load all basic controllers by:

mon launch unitree_control load_controllers.launch

You can start the controller using rqt_controller_manager

sudo apt install ros-noetic-rqt-controller-manager
rosrun rqt_controller_manager rqt_controller_manager

Start a controller by right clik and select start.

NOTE: The legs_controller and feet_controller should not running in the same time!

After start the controller (for example: feet_controller), you can control the leg/legs or foot/feet by sending message to topic, like the command line code above command FL foot follow a bezier cure with height 0.1 meter and finally reach the position {x: 0.0, y: 0.0, z: 0.7} in 0.5 second.

rostopic pub /cmd_feet unitree_msgs/FeetCmd "header:
  seq: 0
  stamp: {secs: 1, nsecs: 0}
  frame_id: ''
leg_prefix:
- {prefix: 0}
touch_state: [1]
ground_reaction_force:
- {x: 0.0, y: 0.0, z: 0.0}
pos_final:
- {x: 0.0, y: 0.0, z: 0.7}
height: [0.1]
swing_time: [0.5]"

You can try other legs and final position or write another node to perform some high level control. DON'T FORGET TO UPDATE THE TIME STAMP OF EACH MESSAGE!!! 不要忘记更新每个消息的时间戳!!!

The gif below shows a loop action command by a simple script.

However, using the ROS topic interface in high frequency and real-time requirements is NOT RECOMMEND and UNSAFE.

You had better inherit from legs_controller or feet_controller as the base class, create a new controller running in the hardware_interface, which allow you command the leg or joint directly using pointer in 1kHz and real-time safe . [TODO]() shows a locomotion controller base on Cheetah-Software .

Bugs & Feature Requests

Please report bugs and request features using the Issue Tracker .