Skip to content

DominicZahn/Neo-Construct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neo Construct

A ready-to-go robotics optimal control setup in the form of a Docker container. The Neo Construct encapsulates a whole ROS2 Gazebo Jetty environment to solve robotics problems with a pipeline of Acados and Pinocchio.

It only uses Docker and Make to manage the Docker. So this setup can be used directly from the command line without requiring any additional software.

Quick Start

  1. Clone the repository or create your own with this as a template
git clone --recursive https://github.com/DominicZahn/Neo-Construct.git
  1. Enter the parent directory, which holds the Dockerfile and Makefile. From there build the Docker with
make build

The first time this will take a long time (~1-2h), as it builds lots of packages from source.

  1. After the Docker was built successfully it can be run by
make run
  1. Now inside the neo-construct container you can enjoy the whole containerized environment by starting up on of the examples. The docker can be controlled by the Makefile and general docker commands.

Examples

simple_example

Here are basic examples that do not require a running simulation or ROS2 in general.

arm.py

A small three segment robot arm model is defined using the arm.urdf. It's task is to move the end effector from the default position to the provided target position. Both are marked with a white ball.

For rigid-body dynamics Pinocchio is utilized with Acados as an optimal control framework. This example provides a good starting point to learn about Pinocchio and Acados in general without the need of a difficult model or overhead from an external simulation.

First launch the python script with

python3 arm.py

Be aware that this needs to be run from inside the simple_example folder.

The script uses MeshCat for visualization. It renders the robot inside a browser window on a localhost window at

http://127.0.0.1:7000/static/

arm_preview

MeshCat does not automatically refresh the side when the script is restarted. The browser window needs to be refreshed (F5) after each run to update the robots pose.

File Structure

The main project and ROS2 packages are put inside the src directory. It is mounted directly into the Docker, so everything in here will be synced in both directions.

To build everything, the alias build can be used inside the container to move to the parent workspace folder (ws) and then execute colcon build --symlink-install. With this setup, the problem of creating random colcon artifacts is a thing of the past.

.
|-+-- ws
| |   +-- simple_example
| |   +-- src
| |   |   +-- (*)
| |   +-- ext_pkgs
| |   |   +-- (**)
| |   |
| |   +-- build
| |   +-- install
| |   +-- log
| |
| +-- Dockerfile
| +-- Makefile
| +-- .gitignore
| +-- README.md
|
+-- ext_pkgs (**)

(*) your ROS2 project goes here
(**) alows to mount external packages into the docker

Docker Build Requirements

Docker Management

The docker is managed by the Makefile. The four commands bundle some arguments and management commands together to create a more friendly Docker experience.

Command Description
run launches the docker with docker run and enables X11-forwarding on the host machine
build calls docker build with the correct container name
clean removes colcon artifacts in ws and deletes Docker from the internal list
-> full build is necessary!
rebuild combination of clean and build without the use of cache
stop can be used to stop the docker when the process where run was called is not accessible (calls docker stop)

Most of the time you will use make build once and then only launch the docker with make run. A rebuild is only adjusted if the container configuration inside the Dockerfile was adjusted.

About

A ready-to-go robotics optimal control setup in the form of a Docker container. The Neo Construct encapsulates a whole ROS2 Gazebo environment to solve robotics problems with a pipeline of Acados and Pinocchio.

Topics

Resources

License

Stars

Watchers

Forks

Contributors