├── LICENSE ├── MATLAB └── read_experiment_binary.m └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jenna Reher (jreher@caltech.edu) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MATLAB/read_experiment_binary.m: -------------------------------------------------------------------------------- 1 | % Place this file in the saved directory of the data you would like to plot 2 | % Default location for the current release of the code is at ~/datalog/read_experiment_binary.m 3 | % This script opens the binary datalogs for estimation and control which is saved by the Caltech Cassie software 4 | % 5 | % Author: Jenna Reher (jreher@caltech.edu) 6 | % ------------------------------------------------------------------------------------------------------------- 7 | 8 | do_estimation = true; 9 | do_standing = true; 10 | do_walking = true; 11 | 12 | rootpath = pwd; 13 | 14 | %% Estimation 15 | if do_estimation 16 | ndbge = 51; 17 | fileID = fopen(strcat(rootpath, '/estimation_log.bin')); 18 | raw = fread(fileID,'float'); 19 | nlogse = floor(length(raw) / ndbge); 20 | 21 | te = zeros(1,nlogse); 22 | quat = zeros(4,nlogse); 23 | gyro = zeros(3,nlogse); 24 | accel = zeros(3,nlogse); 25 | v = zeros(3,nlogse); 26 | enc = zeros(14,nlogse); 27 | denc = zeros(14,nlogse); 28 | ach = zeros(2,nlogse); 29 | dach = zeros(2,nlogse); 30 | contact = zeros(2,nlogse); 31 | current = zeros(1,nlogse); 32 | voltage = zeros(1,nlogse); 33 | 34 | for i = 1:nlogse 35 | % Index in array 36 | j = ndbge * (i-1) + 1; 37 | 38 | % Extract values into proper sizes 39 | tsec = raw(j); 40 | tnsec = raw(j+1); 41 | quat(:,i) = raw(j+2 : j+5); 42 | gyro(:,i) = raw(j+6 : j+8); 43 | accel(:,i) = raw(j+9 : j+11); 44 | v(:,i) = raw(j+12 : j+14); 45 | enc(:,i) = raw(j+15 : j+28); 46 | denc(:,i) = raw(j+29 : j+42); 47 | ach(:,i) = raw(j+43 : j+44); 48 | dach(:,i) = raw(j+45 : j+46); 49 | contact(:,i) = raw(j+47 : j+48); 50 | current(i) = raw(j+49); 51 | voltage(i) = raw(j+50); 52 | 53 | te(i) = tsec + tnsec; 54 | end 55 | t0 = te(1); 56 | te = te - te(1); 57 | dte = gradient(te); 58 | 59 | figure(20000); 60 | plot(te,dte); 61 | xlabel('Time (s)'); 62 | ylabel('Est dt (s)'); 63 | ylim([0, 0.05]); 64 | 65 | figure(501); 66 | plot(te, gyro); 67 | xlabel('Time (s)'); 68 | ylabel('Gyro (rad/s)'); 69 | 70 | figure(5011); 71 | plot(te, accel); 72 | xlabel('Time (s)'); 73 | ylabel('Accel (m/s/s)'); 74 | 75 | figure(502); 76 | plot(te, v); 77 | xlabel('Time (s)'); 78 | ylabel('Vel (m/s)'); 79 | 80 | figure(503); 81 | plot(te, contact); 82 | xlabel('Time (s)'); 83 | ylabel('Contact'); 84 | ylim([-0.1, 1.1]); 85 | 86 | figure(504); 87 | plot(te, enc); 88 | xlabel('Time (s)'); 89 | ylabel('Encoder (rad)'); 90 | 91 | figure(505); 92 | plot(te, denc); 93 | xlabel('Time (s)'); 94 | ylabel('DEncoder (rad/s)'); 95 | 96 | figure(506); 97 | plot(te, ach); 98 | xlabel('Time (s)'); 99 | ylabel('Ach defl (rad)'); 100 | 101 | figure(507); 102 | plot(te, quat); 103 | xlabel('Time (s)'); 104 | ylabel('Quaternion'); 105 | 106 | figure(508) 107 | subplot(3,1,1); 108 | plot(te, voltage); 109 | ylabel('Voltage'); 110 | subplot(3,1,2); 111 | plot(te,current); 112 | ylabel('Current (A)'); 113 | subplot(3,1,3); 114 | plot(te,current.*voltage); 115 | ylabel('Power (W)'); 116 | xlabel('Time (s)'); 117 | end 118 | 119 | %% Standing 120 | if do_standing 121 | ndbgc = 60; 122 | fileID = fopen(strcat(rootpath, '/stand_log.bin')); 123 | raw = fread(fileID,'float'); 124 | nlogs = floor(length(raw) / ndbgc); 125 | 126 | tc = zeros(1,nlogs); 127 | ya = zeros(6,nlogs); 128 | dya = zeros(6,nlogs); 129 | yd = zeros(6,nlogs); 130 | dyd = zeros(6,nlogs); 131 | d2yd = zeros(6,nlogs); 132 | V = zeros(1,nlogs); 133 | u = zeros(10,nlogs); 134 | F = zeros(16,nlogs); 135 | delta = zeros(1,nlogs); 136 | 137 | for i = 1:nlogs 138 | % Index in array 139 | j = ndbgc * (i-1) + 1; 140 | 141 | % Extract values into proper sizes 142 | tsec = raw(j); 143 | tnsec = raw(j+1); 144 | ya(:,i) = raw(j+2 : j+7); 145 | dya(:,i) = raw(j+8 : j+13); 146 | yd(:,i) = raw(j+14 : j+19); 147 | dyd(:,i) = raw(j+20 : j+25); 148 | d2yd(:,i) = raw(j+26 : j+31); 149 | V(i) = raw(j+32); 150 | u(:,i) = raw(j+33 : j+42); 151 | F(:,i) = raw(j+43 : j+58); 152 | delta(i) = raw(j+59); 153 | 154 | tc(i) = tsec + tnsec; 155 | end 156 | tc = tc - t0; 157 | dtc = gradient(tc); 158 | 159 | figure(1500); 160 | plot(tc,dtc); 161 | xlabel('Time (s)'); 162 | ylabel('Control dt (s)'); 163 | ylim([0, 0.05]); 164 | 165 | figure(1501); 166 | plot(tc,u); 167 | ylabel('u (Nm)'); 168 | xlabel('t (s)'); 169 | 170 | figure(1502); 171 | plot(tc,ya) 172 | hold on; 173 | plot(tc,yd,'--') 174 | title('ya yd'); 175 | 176 | figure(1503); 177 | plot(tc,dya) 178 | hold on; 179 | plot(tc,dyd,'--') 180 | title('dya dyd'); 181 | 182 | figure(1504); 183 | plot(tc,d2yd); 184 | title('d2yd'); 185 | 186 | figure(1505); 187 | plot(tc, F(1:2,:)); 188 | xlabel('Time (s)'); 189 | ylabel('Force (N or Nm)'); 190 | title('Achilles Constraint'); 191 | 192 | figure(1506); 193 | plot(tc, F(3:6,:)); 194 | xlabel('Time (s)'); 195 | ylabel('Force (N or Nm)'); 196 | title('Rigid Constraint'); 197 | 198 | figure(1507); 199 | subplot(2,1,1); 200 | plot(tc, F(7:11,:)); 201 | ylabel('Left Force (N or Nm)'); 202 | title('Foot Constraints'); 203 | subplot(2,1,2); 204 | plot(tc, F(12:16,:)); 205 | xlabel('Time (s)'); 206 | ylabel('Right Force (N or Nm)'); 207 | 208 | figure(1508); 209 | plot(tc,V); 210 | ylabel('V'); 211 | xlabel('t (s)'); 212 | 213 | figure(1509); 214 | plot(tc,delta); 215 | ylabel('CLF Relaxation'); 216 | xlabel('t (s)'); 217 | end 218 | 219 | %% Walking 220 | if do_walking 221 | ndbgw = 82; 222 | fileID = fopen(strcat(rootpath, '/qp_walk_log.bin')); 223 | raw = fread(fileID,'float'); 224 | nlogsw = floor(length(raw) / ndbgw); 225 | 226 | tw = zeros(1,nlogsw); 227 | tau = zeros(1,nlogsw); 228 | dtau = zeros(1,nlogsw); 229 | ya_w = zeros(9,nlogsw); 230 | dya_w = zeros(9,nlogsw); 231 | yd_w = zeros(9,nlogsw); 232 | dyd_w = zeros(9,nlogsw); 233 | V_w = zeros(1,nlogsw); 234 | u_w = zeros(10,nlogsw); 235 | Fdes_w = zeros(11,nlogsw); 236 | delta_w = zeros(1,nlogsw); 237 | v_d_w = zeros(2,nlogsw); 238 | v_a_w = zeros(2,nlogsw); 239 | avg_v_w = zeros(2,nlogsw); 240 | raibert_w = zeros(3,nlogsw); 241 | uff_w = zeros(10,nlogsw); 242 | 243 | for i = 1:nlogsw 244 | % Index in array 245 | j = ndbgw * (i-1) + 1; 246 | 247 | % Extract values into proper sizes 248 | tsec = raw(j); 249 | tnsec = raw(j+1); 250 | tau(:,i) = raw(j+2); 251 | dtau(:,i) = raw(j+3); 252 | ya_w(:,i) = raw(j+4 : j+12); 253 | dya_w(:,i) = raw(j+13 : j+21); 254 | yd_w(:,i) = raw(j+22 : j+30); 255 | dyd_w(:,i) = raw(j+31 : j+39); 256 | V_w(:,i) = raw(j+40); 257 | u_w(:,i) = raw(j+41 : j+50); 258 | Fdes_w(:,i) = raw(j+51 : j+61); 259 | delta_w(:,i) = raw(j+62); 260 | v_d_w(:,i) = raw(j+63 : j+64); 261 | v_a_w(:,i) = raw(j+65 : j+66); 262 | avg_v_w(:,i) = raw(j+67 : j+68); 263 | raibert_w(:,i) = raw(j+69 : j+71); 264 | uff_w(:,i) = raw(j+72 : j+81); 265 | 266 | tw(i) = tsec + tnsec; 267 | end 268 | tw = tw - t0; 269 | dtw = gradient(tw); 270 | 271 | figure(40000); 272 | plot(tw,dtw); 273 | xlabel('Time (s)'); 274 | ylabel('Walk dt (s)'); 275 | ylim([0, 0.05]); 276 | 277 | figure(40001); 278 | subplot(2,1,1); 279 | plot(tw, tau); 280 | ylabel('Tau'); 281 | subplot(2,1,2); 282 | plot(tw, dtau); 283 | ylabel('dTau'); 284 | xlabel('Time (s)'); 285 | 286 | figure(500000); 287 | plot(tw, avg_v_w); 288 | ylabel('Velocity (m/s)'); 289 | xlabel('Time (s)'); 290 | title('Average step velocity'); 291 | 292 | figure(500001); 293 | plot(tw, v_d_w, '--'); 294 | hold on; 295 | plot(tw, v_a_w); 296 | ylabel('Velocity (m/s)'); 297 | xlabel('Time (s)'); 298 | title('Velocity actual/desired comparison'); 299 | 300 | figure(40002); 301 | plot(tw, ya_w(1:2,:)); 302 | hold on; 303 | plot(tw, yd_w(1:2,:), '--'); 304 | ylabel('Angle (rad)'); 305 | xlabel('Time (s)'); 306 | title('Floating Base Outputs'); 307 | 308 | figure(40003); 309 | plot(tw, ya_w([3,8],:)); 310 | hold on; 311 | plot(tw, yd_w([3,8],:), '--'); 312 | ylabel('Angle (rad)'); 313 | xlabel('Time (s)'); 314 | title('Hip Yaw Outputs'); 315 | 316 | figure(40004); 317 | plot(tw, ya_w(4:5,:)); 318 | hold on; 319 | plot(tw, yd_w(4:5,:), '--'); 320 | ylabel('Angle (rad)'); 321 | xlabel('Time (s)'); 322 | title('Leg length Outputs'); 323 | 324 | figure(40005); 325 | plot(tw, ya_w(6,:)); 326 | hold on; 327 | plot(tw, yd_w(6,:), '--'); 328 | ylabel('Angle (rad)'); 329 | xlabel('Time (s)'); 330 | title('Leg Angle Outputs'); 331 | 332 | figure(40006); 333 | plot(tw, ya_w(7,:)); 334 | hold on; 335 | plot(tw, yd_w(7,:), '--'); 336 | ylabel('Angle (rad)'); 337 | xlabel('Time (s)'); 338 | title('Swing Roll Outputs'); 339 | 340 | figure(40007); 341 | plot(tw, ya_w(9,:)); 342 | hold on; 343 | plot(tw, yd_w(9,:), '--'); 344 | ylabel('Angle (rad)'); 345 | xlabel('Time (s)'); 346 | title('Swing Foot Outputs'); 347 | 348 | figure(40008); 349 | plot(tw, uff_w, '--'); 350 | hold on; 351 | plot(tw, u_w); 352 | ylabel('Torque (Nm)'); 353 | xlabel('Time (s)'); 354 | title('Torque (-- Feedforward) (- Total)'); 355 | 356 | figure(400075); 357 | plot(tw, Fdes_w); 358 | title('Desired constraint forces'); 359 | 360 | figure(400085); 361 | plot(tw, raibert_w); 362 | title('Raibert Cartesian delta position'); 363 | end 364 | 365 | 366 | 367 | 368 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Caltech Cassie Documentation Repository 2 | This serves as the central repository for the publicly released operational instructions and installation scripts for the Caltech Cassie biped project. If you use our code, please throw us a citation or acknowledgement (relevant papers listed below). 3 | 4 | Review the documentation here thoroughly before pulling our other repos and trying to use them on your robot, we provide helpful instructions and examples for how to set up your Linux development computer for testing in Gazebo or to prepare the Intel NUC on the actual Cassie hardware as we have done. If you are unsure of how to modify part of the existing code, or if the gains and controllers which are provided here are having problems, feel free to raise a issue here or reach out: jenna.reher@gmail.com. 5 | 6 | __IMPORTANT: This code will not work on versions of Ubuntu 20.04 or newer! We strongly recommend Ubuntu 18.04 with ROS Melodic.__ 7 | 8 | [](hthttps://youtu.be/bzCYE3DETMI) 9 | 10 | [](https://youtu.be/SvhjPZqSGFI) 11 | 12 | ## Description of associated repositories: 13 | Below is a list of all packages used for the Caltech controller implementation. A general installation procedure is detailed lower in this README. For package specific instructions if you are looking to modify the code, please see the instructions in each repo. 14 | 15 | * [Amber Developer Stack](https://github.com/jpreher/amber_developer_stack): This is a set of general base utilities. These are primarily focused on debugging, wrappers for various things such as YAML, Eigen, and qpOASES, and general utilities which are not necessarily Cassie specific. 16 | * [Cassie Description](https://github.com/jpreher/cassie_description): Contains all necessary files for running the MATLAB codegen for the Cassie model. It also has classes for MATLAB and for C++ with several general functions to compute the constraints, dynamics, and kinematics efficiently. 17 | * [Cassie Common Toolbox](https://github.com/jpreher/cassie_common_toolbox): This is a common set of utilities and helper functions that are specific to Cassie. 18 | * [Cassie Interface](https://github.com/jpreher/cassie_interface): Contains the launch files for starting up the various processes. Also has the primary ROS node, which interfaces to the Simulink xPC via UDP and listens for control inputs to pass along. 19 | * [Cassie Estimation](https://github.com/jpreher/cassie_estimation): Contains functionality for estimating the heelspring deflections, contacts, and linear velocity. 20 | * [Cassie Controllers](https://github.com/jpreher/cassie_controllers): The main control code which chooses the torques to send to the robot. 21 | * [Cassie Optimization](https://github.com/jpreher/cassie_opt): MATLAB-based trajectory optimization for obtaining compliant walking motion libraries. 22 | 23 | ## Setting up a computer for using the packages: 24 | This section will first detail the setup of a fresh Intel NUC computer, assuming that it has not yet been used. If you have already established your NUC, feel free to follow along with the instructions, and see if there are any additional steps that would be helpful to implement. If you are looking to just run the controller on a Linux computer in simulation or for development, you can skip the Intel NUC on Cassie section, and start with the Development Computer section. 25 | 26 | ### Intel NUC on Cassie 27 | First, we recommend purchasing and using two small accessories, which will make your life significantly easier. A [network switch](https://www.amazon.com/dp/B074VZ236M/ref=twister_B074W7YZY3?_encoding=UTF8&psc=1) will allow you to connect the Simulink xPC with the NUC, and still leave an additional connection for you to directly connect and subscribe to the ROS network on a development computer. Also, a USB splitter will let you connect peripherals easily to the already exposed ports on the top of Cassie's pelvis. Finally, we drilled a small hole along the top of the back cover of the robot, so that we could run an HDMI cable to a monitor from the NUC. 28 | 29 | Assuming that the computer does not yet have an OS, we recomend using [Ubuntu 18.04](http://releases.ubuntu.com/18.04.4/). Install accordingly, and choose the minimal installation and automatic login options. Once the OS is installed, we want to ensure that the machine boots into Console mode and does not run graphics. This will save additional overhead and help the controller run more smoothly, since our current implementation is only soft real-time. To do this, simply open a terminal and set 30 | ``` bash 31 | sudo systemctl set-default multi-user.target 32 | ``` 33 | At any point, if you would like to pull up the GUI mode, you can do that by just running 34 | ``` bash 35 | sudo systemctl start gdm3.service 36 | ``` 37 | If you have already installed or prefer lightdm, this would just be `sudo lightdm start`. As a side note, you can also work in multiple terminals simultaneously while in this mode. Simply press `CTRL+ALT+F(1-6)` and this will switch between six distinct terminals. You will see the current terminal `tty(1-6)` at the top of your screen. 38 | 39 | If you have not been working on the NUC already, the minimal installation is likely not running unnecessary background processes. However, if you have, you may want to disable all unncessessary boot and background processes which may interfere with the controller. We also recommend disabling bluetooth, and possibly the wifi after you have installed all packages (though we have not had any issues leaving the wifi connected). You will be able to tell that you are having timing issues is there are small 'pops' in the controller, or if you look at the timing data from the logger and see greater than 5-10% jitter in the loop frequency. 40 | 41 | As a final step, you should also install the [PREEMPT_RT kernel](https://rt.wiki.kernel.org/index.php/Main_Page). This will be useful for mitigating timing issues when we are later elevating our controller and interface nodes into real-time priority. 42 | 43 | For the Simulink xPC, our code is built around using a UDP connection as Agility Robotics had built out some support for this functionality. You can simply go to their software page [here](https://github.com/agilityrobotics/cassie-doc/tree/master/Software) and use their `UdpRealTime` controller. We have specified the network address in [cassie_interface.cpp](https://github.com/jpreher/cassie_interface/blob/e9230be69e1300bea12b9643510c64d4795e582c/src/cassie_interface_node.cpp#L109), please ensure that this address matches what is in your compiled Simulink code as it is different from their default. Agility had a version which can be edited and compiled in their code examples folder. 44 | 45 | 46 | ### Development Computer 47 | 48 | The packages are built around a ROS framework, we recommend following the instructions for installing the Desktop-Full version of [ROS Melodic](http://wiki.ros.org/melodic/Installation/Ubuntu) if you used Ubuntu 18.04, or if using an older version using [ROS Kinetic](http://wiki.ros.org/kinetic/Installation/Ubuntu). *Note: We have only tested on hardware with Melodic, however, there does not appear to be any compatability issues in simulation for Kinetic, you will just need to manually upgrade a few packages as shown below.* 49 | 50 | and then install several necessary packages 51 | ``` bash 52 | sudo apt install libeigen3-dev libyaml-dev build-essential ros-melodic-gazebo-ros 53 | ``` 54 | If you are using Kinetic, you will need to remove Gazebo7 and manually install Gazebo9 55 | ``` bash 56 | sudo apt remove ros-kinetic-gazebo* gazebo* 57 | sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' 58 | wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - 59 | sudo apt update 60 | sudo apt install ros-kinetic-gazebo9-* 61 | sudo apt upgrade 62 | ``` 63 | 64 | If you plan to run Gazebo simulations, you will also need to add the following lines to the `.bashrc` or `.bash_aliases` file to ensure that it can find the associated model and plugin. 65 | ``` bash 66 | export GAZEBO_PLUGIN_PATH=${HOME}/cassie_ws/devel/lib/:$GAZEBO_PLUGIN_PATH 67 | export GAZEBO_MODEL_PATH=${HOME}/cassie_ws/src/cassie_description/:$GAZEBO_MODEL_PATH 68 | ``` 69 | If you open another terminal before finishing the instructions below then you will see an error when it executes the command. After building `cassie_ws` they should go away. 70 | 71 | Create a separate install space for third party repositories we are going to install, and install the [RBDL](https://rbdl.github.io/) package with the optional URDF parser. 72 | ``` bash 73 | mkdir ~/repos 74 | cd ~/repos 75 | git clone https://github.com/rbdl/rbdl.git 76 | sed -i 's/boost::shared_ptr/std::shared_ptr/g' ~/repos/rbdl/addons/urdfreader/urdfreader.cc # ONLY RUN THIS LINE IF USING UBUNTU 18.04 77 | mkdir ~/repos/rbdl/build 78 | cd ~/repos/rbdl/build 79 | cmake -D CMAKE_BUILD_TYPE=Release -D RBDL_BUILD_ADDON_URDFREADER=true ../ 80 | make 81 | sudo make install 82 | ``` 83 | If you are using Ubuntu 16.04 then you will need to install a newer version of Eigen (>3.3) than comes with ROS Kinetic *(i.e. you only need to do this if using 16.04)* - This is a temporary fix until a better solution is found for the Eigen 3.3 unsupported packages 84 | ``` bash 85 | cd ~/repos 86 | curl https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz | tar -xz 87 | mkdir ~/repos/eigen-3.3.7/build 88 | cd ~/repos/eigen-3.3.7/build 89 | cmake .. 90 | sudo make install 91 | sed -i 's/Eigen\/EulerAngles/eigen3\/unsupported\/Eigen\/EulerAngles/g' ~/cassie_ws/src/cassie_common_toolbox/include/cassie_common_toolbox/geometry.hpp 92 | ``` 93 | 94 | 95 | Create the catkin workspace where our code will live 96 | ``` bash 97 | mkdir ~/cassie_ws 98 | mkdir ~/cassie_ws/src 99 | cd ~/cassie_ws/src 100 | catkin_init_workspace 101 | ``` 102 | then clone all of the necessary repositories 103 | ``` bash 104 | git clone https://github.com/jpreher/cassie_description.git 105 | git clone https://github.com/jpreher/cassie_interface.git 106 | git clone https://github.com/jpreher/cassie_controllers.git 107 | git clone https://github.com/jpreher/cassie_estimation.git 108 | git clone https://github.com/jpreher/cassie_common_toolbox.git 109 | git clone https://github.com/jpreher/amber_developer_stack.git 110 | ``` 111 | 112 | Before building, the Cassie model source code needs to either be generated or downloaded and extracted. We detail instructions for populating the code in the `cassie_description` package in the [associated README](https://github.com/jpreher/cassie_description/blob/master/README.md). *Note: If you don't have access to Matlab and Mathematica, or are not interested in modifying the expressions, you can just [download an archive here](https://www.dropbox.com/s/ff3dfvctna8amwy/cassie_description_pregen.zip?dl=0) and extract it into the `cassie_description` folder.* 113 | 114 | Then simply build the workspace in Release mode, there should be no errors. 115 | ``` bash 116 | cd ~/cassie_ws 117 | catkin_make -DCMAKE_BUILD_TYPE=Release 118 | ``` 119 | 120 | *Note: For running individual simulations in Gazebo of the walking controllers and crouching controller there does not yet exist a simple flag or switch to determine the behavior that you would like. Instead, the corresponding behavior can be commanded to the simulation controller by manually changing a spoofed joystick value in [cassie_interface.cpp](https://github.com/jpreher/cassie_interface/blob/e9230be69e1300bea12b9643510c64d4795e582c/src/cassie_interface_node.cpp#L435)* 121 | 122 | 123 | ## Running the software 124 | 125 | The software is launched from two roslaunch files, one for simulation and the other for hardware. 126 | ``` bash 127 | roslaunch cassie_interface cassie_interface_simulated.launch 128 | roslaunch cassie_interface cassie_interface_hardware.launch 129 | ``` 130 | 131 | There is currently a separate launchfile example for running the full locomotion QP controller (standing and walking). To run this instead of the inverse dynamics controller, simply use this launch command instead: 132 | ``` bash 133 | roslaunch cassie_interface cassie_interface_walkqp_simulated.launch 134 | ``` 135 | 136 | On hardware this will initialize all control and estimation parameters, as well as boot up the controller node. In simulation this will spawn a Gazebo instance, and link the plugin with our interface node. The controller must be started in a separate terminal window via 137 | ``` bash 138 | rosrun cassie_controllers locomotion_node 139 | ``` 140 | You can also simply modify the launch files to run, or not run the various nodes on launch. This is mainly if you would prefer to have more granular control over what gets started when, or when debugging. 141 | 142 | The Gazebo instance will start paused, you can start the simulation by clicking play on the bottom bar. The simulation will then lower Cassie, and then let go of the pelvis entirely. The controller will then simply run the optimization based crouching controller presented presented in our literature below. 143 | 144 | If you see `Error in REST request` when launching the Gazebo simulation, simply open the file `~/.ignition/fuel/config.yaml` and change `url: https://api.ignitionfuel.org` to `url: https://api.ignitionrobotics.org`. 145 | 146 | I have provided a [script](https://github.com/jpreher/cassie_documentation/blob/master/MATLAB/read_experiment_binary.m) which can be used to plot the data logged from experiments. There are three data files which are produced if the [associated flag is set in the launchfile](https://github.com/jpreher/cassie_interface/blob/255acd667f8fc447c9666cc4327aeeab6340b44b/launch/cassie_interface_hardware.launch#L8): 1) estimation_log.bin (enabled through the flag log_estimation) - this logs almost all data which is passed in and out of the cassie_interface_node, covering kinematic data, and all values from the floating-base, spring, and contact estimators. 2) stand_log.bin (enabled through the flag log_controller) containing all control feedback data from the CLF-QP or ID standing controller. 3) qp_walk_log.bin (enabled through the flag log_controller) containing all control feedback data from the CLF-QP or ID walking controller. 147 | 148 | 149 | ## Related literature: 150 | * Reher, Jenna and Aaron D. Ames. "Inverse Dynamics Control of Compliant Hybrid Zero Dynamic Walking." Submitted to 2021 IEEE ICRA and Robotics and Automation Letters (RA-L). 151 | ``` 152 | @inproceedings{reher2021inversedynamicswalking, 153 | title={Inverse Dynamics Control of Compliant Hybrid Zero Dynamic Walking}, 154 | author={Reher, Jenna and Ames, Aaron D}, 155 | booktitle={Submitted to 2021 IEEE ICRA and Robotics and Automation Letters (RA-L)}, 156 | } 157 | ``` 158 | 159 | * Reher, Jenna, Claudia Kann, and Aaron D. Ames. "An inverse dynamics approach to control Lyapunov functions." 2020 American Control Conference (ACC). IEEE, 2020. 160 | ``` 161 | @inproceedings{reher2020inverse, 162 | title={An inverse dynamics approach to control {Lyapunov} functions}, 163 | author={Reher, Jenna and Kann, Claudia and Ames, Aaron D}, 164 | booktitle={2020 American Control Conference (ACC)}, 165 | pages={2444--2451}, 166 | year={2020}, 167 | organization={IEEE} 168 | } 169 | ``` 170 | 171 | * Reher, Jenna, Wen-Loong Ma, and Aaron D. Ames. "Dynamic walking with compliance on a Cassie bipedal robot." 2019 18th European Control Conference (ECC). IEEE, 2019. 172 | ``` 173 | @inproceedings{reher2019dynamic, 174 | title={Dynamic walking with compliance on a {Cassie} bipedal robot}, 175 | author={Reher, Jenna and Ma, Wen-Loong and Ames, Aaron D}, 176 | booktitle={2019 18th European Control Conference (ECC)}, 177 | pages={2589--2595}, 178 | year={2019}, 179 | organization={IEEE} 180 | } 181 | ``` 182 | 183 | * The official Agility Robotics documentation and software release for the Cassie biped. 184 | 185 | https://github.com/agilityrobotics/agility-cassie-doc 186 | --------------------------------------------------------------------------------