• Stars
    star
    145
  • Rank 254,144 (Top 6 %)
  • Language
    C++
  • License
    BSD 3-Clause "New...
  • Created almost 6 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Feedback Controller for a Cassie Robot

This repository uses the Simulator and Realtime Simulink models from Agility Robotics. It contains a MATLAB/Simulink implementation of a basic feedback controller for the bipedal robot Cassie. The controller utilizes virtual constraints and gait libraries and it has been tested on Cassie Blue, Cassie Maize, and Cassie Cal on various terrains including indoor, outdoor environments, and terrains covered with snow, or grass. What you might expect from this basic controller can be found in the following videos:

The details of the controller’s design and implementation are explained in: “Feedback Control of a Cassie Bipedal Robot: Walking, Standing, and Riding a Segway " (arxiv.org/abs/1809.07279). Please cite this paper and the GitHub site if you use the open-source code (the BibTeX entry is located at the bottom of the README).

Running the controller in Simulink simulation:

  1. Use MATLAB 2017b. If you use MATLAB 2018, you need to modify the solver from auto to ode45
  2. Download this repository and execute the script "start_up.m" to add all functions needed to the MATLAB searchable path.
  3. Open “\Controllers\Flatground\FG_Simulator.slx” and run the simulation. This will automatically open Matlab's mechanics explorer and show animations after compiling.
  4. Optional:before doing the parameter tuning on your physical robot, you could play with the control parameters in the simulation. You can open "Controllers\Flatground\utils+PreFunctions\ParamInit.m” and adjust the parameters there to see how they affect the robot’s closed-loop motion in simulation.  

Preparations for the online tuning:

While the Cassie robots are quite similar to one another, they have been modified throughout their production run. Hence, some tuning for your robot may be required. In order to achieve more robust performance during walking and standing, please follow the instructions below for the parameter tuning process.

  1. Set up the development PC according to the instructions in the following link: https://github.com/agilityrobotics/agility-cassie-doc/wiki/Setting-Up-Development-PC.
  2. Follow the instructions on the Agility Robotics’ Website (https://github.com/agilityrobotics/agility-cassie-doc/wiki/Creating-Standalone-Application) to make a USB standalone controller using the Simulink RealTime model (FG_RealTime_2.slx) located at “\Controllers\Flatground\ ... “. We recommend using 'Microsoft Visual C++ 2015 Professional' as the default compiler to ensure a proper build.
  3. Carefully tether the robot to a gantry or safety cable. Plug in the standalone USB controller, perform the startup procedure and then the homing procedure. Suspend the robot so that hips are approximately 1 meter high while keeping Cassie's feet on the ground. Make sure the SB switch on the radio controller is in the middle position (standing controller) and then enable the power by turning on the SA switch (move it up). The motor torques will ramp up gradually over a 10 second window. If Cassie does not stand up as expected, try to gradually adjust the left slider (LS) on the radio controller to tune the desired leg length until Cassie can balance itself. The following assumes that balancing is achieved. Else, go back and check your calibration and/or the motor commutation. The Center of Mass of your robot should definitely be within the support polygon of the downloaded controller.
  4. Plug in the Ethernet cable and then open Simulink Real-Time explorer by typing slrtexplr in the MATLAB command window.
  5. Run the script (addTargetPC.m) stored in the Shortcuts folder to add CassieV3 to the targets.
  6. Right-click CassieV3 and then select connect. The indicator will turn green if the connection has been established successfully.
  7. Click the File-open-instrument Panel and select the file (InstrumentPanel1.slrtip) located at “Controllers\Flatground\utils\3...”. Then run the instrument panel by clicking the run button on the upper-left corner. All of the default values for the tunable gains will pop up automatically.

Radio Function Description

Walk Controller

Command Description
LV Move in Longitudinal direction
LH Move in Lateral direction
RH Change yaw angle (turnning)
S1 Adjust drifting in Longitudinal direction
SA Emergency Stop
SB Switch Controller, (-1, 0) standing, (+1) walking

Stand Controller

Command Description
RV Torso pitch
RH Move torso in lateral direction
S2 Adjust COM position
LS Adjust Leg length
SA Emergency Stop
SB Switch Controller, (-1, 0) standing, (+1) walking

Tuning the standing controller on Cassie’s hardware to improve disturbance rejection:

  1. The estimated Center of Mass position in the controller may be inaccurate due to variation in the Cassie robots. To adjust the estimated Center of Mass, adjust the parameter stand_offset in the instrument panel until the readings in Channels 6 and 7 become 0. Increasing the stand_offset will decrease the readings in Channels 6 and 7. It is recommended to change the offset in increments of 0.01 or 0.005.
  2. Go to the right side of the panel and find the section called PD gain on joints (stand)
  3. You can tune the proportional gain (Kp) and derivative gain (Kd) for each joint by left-clicking the corresponding box and typing the desired values. The typed value will be sent to the hardware immediately after you move the cursor out of the box by left-clicking anywhere else on the panel.
  4. Initially,  push the robot gently. If the pelvis falls forward or backward very easily, try to increase the values of Kp and Kd for each joint. If the toes tilt up or down very often, try reducing the proportional gain for the toe joints.
  5. If the motors are vibrating, try reducing the values of the derivative gains.

Tuning the walking controller on Cassie hardware:

  1. With the robot still attached to a safety cable, you can transition from the standing controller to the walking controller by setting the SB switch up. The robot will start to step in place.
  2. If the robot is drifting to one side or turning to one direction, try to tune the values in the offset section: reduce the value of sagittal_offset if the robot is stepping backwards; reduce the value of lateral_offset if it is drifting to the right side; and increase the turning_offset if Cassie is turning to the left.
  3. Next, adjust the PD gains in the oot placement section to stabilize the walking speed. If Cassie oscillates back and forth in the sagittal plane, reduce the value of Kp and increase the value of Kd in the Kfs row. If Cassie cannot reject disturbances in the lateral direction,  increase the value of Kd in the Kfl row. Occasionally, if the PD gains for the lateral foot placement are too aggressive, the swing leg may interfere with the stance leg when moving inwards. You might gradually reduce the value abduction_inward_gain to avoid such situations.
  4. During walking, if Cassie's feet hammer on the ground very hard, try to gradually increase the value knee_compensation in the compensation section.

Tuning walking standing switch controllers on Cassie robot:

  1. In order to switch from standing to stepping, Cassie will always shift its center of mass position to the left side and then lifts its right leg first. Try to tune the value of shift_distance in the walking standing switch section to achieve more robust switching behavior. If the robot falls to the right side very often after its first step, try to increase shift_distance. If the robot leans to the left sides, try to decrease shift_distance instead.
  2. When switching to the stance controller from walking, several more values should be properly adjusted. These include the four values listed in the walking standing switch section. When the switching command is sent out, Cassie will not stop stepping immediately. The robot will keep walking for one or two steps depending on when the switch command is received. During this period of time, Cassie will adjust its stance and swing leg abduction angles and prepare for standing. If Cassie oscillates after switching to the standing controller, try to tune the value of final_sw_abduction and final_st_abduction to adjust the distance between the two feet during stance to reduce the oscillation.

After all the parameters have been properly adjusted, save all the changes to the "Controllers\Flatground\utils+PreFunctions\ParamInit.m" script. Then build the standalone USB controller again following the procedures given in the preparation section. These values should be loaded automatically to the updated standalone controller.

Related literature:

  • Feedback Control of a Cassie Bipedal Robot: Walking, Standing, and Riding a Segway, by Yukai Gong, Ross Hartley, Xingye Da, Ayonga Hereid, Omar Harib, Jiunn-Kai Huang, and Jessy W. Grizzle. arxiv.org/abs/1809.07279
@misc{1809.07279,
Author = {Yukai Gong and Ross Hartley and Xingye Da and Ayonga Hereid and Omar Harib and Jiunn-Kai Huang and Jessy Grizzle},
Title = {Feedback Control of a Cassie Bipedal Robot: Walking, Standing, and Riding a Segway},
Year = {2018},
Eprint = {arXiv:1809.07279},
}
  • The official Agility Robotics Cassie documentation and software release repository.

https://github.com/agilityrobotics/agility-cassie-doc

More Repositories

1

extrinsic_lidar_camera_calibration

This is a package for extrinsic calibration between a 3D LiDAR and a camera, described in paper: Improvements to Target-Based 3D LiDAR to Camera Calibration. This package is used for Cassie Blue's 3D LiDAR semantic mapping and automation.
MATLAB
357
star
2

LiDARTag

This is a package for LiDARTag, described in paper: LiDARTag: A Real-Time Fiducial Tag System for Point Clouds
C++
249
star
3

Cassie_Model

Repo containing the urdf and frost based models of Cassie
MATLAB
89
star
4

Contact-Aided-Invariant-EKF

Example code for contact-aided invariant extended Kalman filtering.
MATLAB
76
star
5

cassie_alip_mpc

This repository provides an implementation of a bipedal locomotion controller, described in the paper Terrain-Adaptive, ALIP-Based Bipedal Locomotion Controller via Model Predictive Control and Virtual Constraints(pdf)(arXiv). The controller has two components: (1) an Angular Momentum Linear Inverted Pendulum (ALIP)-based Model Predictive Control (MPC) foot placement planner and (2) a gait controller which takes the foot placement solution as an input. This controller enables improved stability for walking on a variety of sloped and textured terrains. The controller is implemented on the Agility Robotics Cassie Robot.
C
74
star
6

CLF_reactive_planning_system

This package provides a CLF-based reactive planning system, described in paper: Efficient Anytime CLF Reactive Planning System for a Bipedal Robot on Undulating Terrain. The reactive planning system consists of a 5-Hz planning thread to guide a robot to a distant goal and a 300-Hz Control-Lyapunov-Function-based (CLF-based) reactive thread to cope with robot deviations. The planning system allowed Cassie Blue to autonomously traverse sinusoidally varying terrain. More experiments are still being conducted and this repo and the paper will be updated accordingly.
C++
54
star
7

SegmentationMapping

C++
53
star
8

Cassie_Controller_AngularMomentum

C++
44
star
9

Cassie_StateEstimation

Code for various extended Kalman filter state estimation methods for Cassie.
C++
41
star
10

LiDAR_intrinsic_calibration

MATLAB
37
star
11

C-Frost

C++
37
star
12

cassie_description

UDRF model of CASSIE robot
CMake
35
star
13

IMOMD-RRTStar

This work proposes an anytime iterative system to concurrently solve the multi-objective path planning problem and determine the visiting order of destinations. The paper has been uploaded to arXiv at https://arxiv.org/abs/2205.14853
C++
31
star
14

Cassie_CFROST

MATLAB
30
star
15

automatic_lidar_camera_calibration

MATLAB
26
star
16

lidar_simulator

MATLAB
17
star
17

multi_object_avoidance_via_clf_cbf

C++
15
star
18

global_pose_estimation_for_optimal_shape

This package introduces the concept of optimizing target shape to remove pose ambiguity for LiDAR point clouds. Both the simulation and the experimental results confirm that by using the optimal shape and the global solver, we achieve centimeter error in translation and a few degrees in rotation even when a partially illuminated target is placed 30 meters away!
MATLAB
8
star
19

sync_lidartag_apriltag

C++
7
star
20

digit_jsonapi_catkin_ws

Python
3
star
21

matlab_utils

MATLAB
3
star
22

docker_images

Dockerfile
2
star
23

AprilTag_ROS

C
2
star
24

torso_design_for_cassie

2
star
25

ROB101-ExtrinsicCalibrationProblem

MATLAB
2
star
26

Digit_Fall_Prediction_Dataset

This dataset is comprised of simulation and hardware trajectories with various faults for the Digit robot during the task of standing. The simulation trajectories contain abrupt, incipient, and intermittent faults, while the hardware trajectories contain abrupt and incipient faults. A tutorial of the dataset can be found in the viz branch.
Jupyter Notebook
2
star
27

planner_msgs

Shell
1
star
28

inekf_msgs

CMake
1
star
29

outdoor_cvo

C++
1
star
30

optimal_shape_generation

This package introduces the concept of optimizing target shape to remove pose ambiguity for LiDAR point clouds. Both the simulation and the experimental results confirm that by using the optimal shape and the global solver, we achieve centimeter error in translation and a few degrees in rotation even when a partially illuminated target is placed 30 meters away!
MATLAB
1
star
31

digit_msgs

Custom ROS messages for digit
CMake
1
star