Skip to content

Repository files navigation

Installing the code

To install natively the code follow these detailed installation instructions. However, we strongly suggest to install a docker image to avoid compatibility issues. To see how to install the docker image follow these instructions.

Running the Code

IDE Pycharm

We recommend to use an IDE to run and edit the Python files, like Pycharm community. To install it, you just need to download and unzip the program:

https://download.jetbrains.com/Python/pycharm-community-2021.1.1.tar.gz

and unzip it inside the home directory.

To be able to keep the plots alive at the end of the program and to have access to variables, you need to "Edit Configurations..." and tick "Run with Python Console". Otherwise the plot will immediately close.

To run the multi-jump optimization check this instructions.

To run the simulation of the multi-jump from a terminal we use the interactive option that allows when you close the program have access to variables:

$ python3 -i $LOCOSIM_DIR/robot_control/base_controllers/climbingrobot_controller2.py

to exit from Python3 console type CTRL+Z

Note: You need the matlab runtime Environment installed to be able to run the simulations that make use of C++ Matlab generated code. We provide a docker image with Ubuntu 20 that already contains Matlab R2023 and Matlab Runtime Environment and all the required code dependencies already installed (you will need only to clone the code and compile it), by following this wiki. Docker has been tested to work with Windows machines, Linux and old MACs (not ARM processors). To be able to run Matlab you just need to

  1. you need to have an installation of Matlab 2023a in your computer (outside docker) that has a standalone license located either in /usr/local/MATLAB/R2023a/licenses or in ~/.matlab/R2023a_licenses. Unfortunately the license should match the Matlab installed inside the docker. The license file looks like this: license_computer_name_XXXXXX_R2023a.lic.
  2. copy the license file into the folder $HOME/trento_lab_framework/.matlab/R2023a_licenses/
  3. start matlab that only once will ask you for the activation
  4. If you have any issue delete the folder .matlab and recreate it

Matlab

This repository provides:

  1. a Matlab simulation with the reduced order model:
matlab/simulation/two_ropes_sim_compact.m
  1. an offline jump optimization (optimal control) generate the jump:
matlab/optimal_control/optimal_control_2_ropes.m
  1. online optimization (mpc) to control the jump.
matlab/optimal_control/mpc/optimize_cpp_mpc.m

In both 2) and 3) it is possible to generate C++ just running first time the code. For the MPC it is also possible to emulate an MPC loop by

matlab/optimal_control/mpc/mpc_loop.m

Tips and Tricks

  1. Some machines, do not have support for GPU. This means that if you run Gazebo Graphical User Interface (GUI) it can become very slow. A way to mitigate this is to avoid to start the Gazebo GUI and only start the gzserver process that will compute the dynamics, you will keep the visualization in Rviz. This is referred to planners that employ BaseController or BaseControllerFixed classes. In the Python code where you start the simulator you need to pass this additional argument as follows:
additional_args = 'gui:=false'
p.startSimulator(..., additional_args =additional_args)
  1. Another annoying point is the default timeout to kill Gazebo that is by default very long. You can change it (e.g. to 0.1s) by setting the _TIMEOUT_SIGINT = 0.1 and _TIMEOUT_SIGTERM = 0.1:
sudo gedit /opt/ros/ROS_VERSION/lib/PYTHON_PREFIX/dist-packages/roslaunch/nodeprocess.py

this will cause ROS to send a kill signal much sooner.

  1. if you get this annoying warning:
Warning: TF_REPEATED_DATA ignoring data with redundant timestamp for frame...

a dirty hack to fix it is to clone this repository in your workspace:

git clone --branch throttle-tf-repeated-data-error git@github.com:BadgerTechnologies/geometry2.git

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages