Debugging Tutorials
Before Startup Preparation
Confirm the Robot Version and Total Mass
Robot Version
-
The robot version is set through the environment variable
$ROBOT_VERSION. The version number is related to different robot models, hardware settings, etc., and must match your own robot. -
Run
echo $ROBOT_VERSIONin the terminal to check the currently set version number. If it is not set, set the version number as follows (modify it according to your actual situation):- Run the following in the current terminal (temporary setting):
export ROBOT_VERSION=17-
Add it to your
~/.bashrcor~/.zshrcterminal configuration file: For example, run:echo 'export ROBOT_VERSION=17' >> ~/.bashrc
This appends it to the end of the
~/.bashrcfile (bash terminal), and it takes effect after restarting the terminal.
Robot Mass
- Because each robot has a different optional configuration, its mass also differs. You need to confirm the robot's total mass to ensure the model is accurate. (The mass is set correctly once at the factory.)
- The robot's total mass is stored in the file
~/.config/lejuconfig/TotalMassV${ROBOT_VERSION}(where${ROBOT_VERSION}is the version number set above). During compilation, this file is read automatically to calibrate the model mass in the repository. - After weighing the robot, simply write the total mass into the
~/.config/lejuconfig/TotalMassV${ROBOT_VERSION}file. - ocs2 uses the cppad automatic differentiation library, and cppad's cache is model-dependent.
- Therefore, each time the total mass file is modified, the cache directory
/var/ocs2/biped_v${ROBOT_VERSION}isautomaticallydeleted, and the cppad model is automatically recompiled on the next run (about 4 minutes). - If you have manually modified the model in the repository, you likewise need to delete the cache directory and recompile the cppad model.
- Therefore, each time the total mass file is modified, the cache directory
Compilation
- The current repository functionality has already been precompiled into the
installedfolder, so you can run the executable scripts directly.