CPS Loki Robot workspace
Go to file
2023-11-20 09:48:37 +01:00
.github/workflows Create docker-publish.yml 2023-10-16 16:16:57 +02:00
.vscode initial commit 2023-05-10 09:27:57 +02:00
docker update 2023-08-02 19:12:24 +02:00
build.py update: added python scripts to make life easier 2023-06-07 11:48:40 +02:00
cleanup.py added cleanup, update repos 2023-06-01 09:39:42 +02:00
dependencies.repos update 2023-08-02 16:18:54 +02:00
docker-compose.yaml update 2023-11-20 09:48:37 +01:00
initialize.py Update initialize.py 2023-05-26 11:45:05 +02:00
office1_map_save.pgm update 2023-06-16 11:21:11 +02:00
office1_map_save.yaml update 2023-06-16 11:21:11 +02:00
office1_map_serial.data update 2023-06-16 11:21:11 +02:00
office1_map_serial.posegraph update 2023-06-16 11:21:11 +02:00
overlay.repos Update overlay.repos 2023-11-20 08:44:52 +01:00
README.md Update README.md 2023-11-20 08:20:44 +01:00
repos.yaml update repos 2023-06-01 10:19:19 +02:00
run_localization.py threading 2023-06-19 08:38:52 +02:00
run_localization.py.bak threading 2023-06-19 08:38:52 +02:00
run_mapping.py update 2023-06-16 11:21:11 +02:00

cps_loki Workspace

Now working via Docker!

Follow the instructions: To use this you need the latest Docker installed and for the multiplatform build the binfmt dependencies for your system. Otherwise just use the pre-built Docker containers. I will try to make the images available public.

TODO: rename packages! First let's check if you are able to pull the pre-built images:

    docker pull ghcr.io/bjoernellens1/bot_mini_ws/bot:overlay
    docker pull ghcr.io/bjoernellens1/bot_mini_ws/bot:guis

Run: For instance on your PC:

    docker compose run guis

This will launch the "guis" container where you will find a full ros2 humble installation and all the dependencies this robot needs.

On the robot:

    docker compose up -d controller teleop

So as you can see, you will be working from the same git repository as well on the robot and your dev PC. For the fact all can run inside Docker makes the project super portable so everyone should be able to tinker around with it. Nice bonus perks: You won't interfere with your computer's local environment. With Docker you are even able to run multiple versions of ROS simultanously, even on unsupported Linux operating systems like Debian or NixOS. Also on MacOS. Windows might be possible but not tested.

Attention: do not launch docker compose without arguments else you will start all services at once and you won't need them.

For building your own images: I would advise to fork the repository and start working in your own one.

    docker buildx bake overlay --load

This will allow you to modify the images to your needs. Enjoy!

Old-fashioned way:

temporary ws for developing ros2 control on robot mini with odrive

needed repos are:

For initialization, just call "python3 initialize.py"

TODO: extend bot_mini_bringup, python scripts for simplyfiyng startup process.

Useful commands:

rosdep install --from-paths src --ignore-src -r -y

Localization using predefined map and navigation

don't forget to set transient_local in rviz to see the map ros2 launch bot_mini_bringup nav2.launch.py map_subscribe_transient_local:=true ros2 launch nav2_bringup localization_launch.py map:=/home/bjorn/Documents/ros_projects/cps_bot_mini_ws/src/bot_mini_bringup/maps/cps_save_map.yaml

Real-Time priority

Process real-time settings

These are the options that allows to configure the process real-time settings:

priority: changes the process priority and set a real-time FIFO priority. This will set the priority of the thread where the ROS 2 executor is running.
cpu-affinity: binds the application to a specific CPU core by setting a CPU mask. For example, to bind the process or thread to CPU 3 (or 2 starting from 0) we set the CPU mask to 4 (100 in binary).
lock-memory: pre-faults memory until no more page faults are seen. This usually allocated a high amount of memory so make sure there is enough memory in the system.
lock-memory-size: specifies the amount of memory we want to pre-allocate. For example lock-memory-size 100 pre-allocates 100 MB.
config-child-threads: specifies if the RMW middleware child threads will inherit the main process settings. This applies for priority and cpu-affinity options.. For example, if config-child-threads False is set, only the main thread where the ROS executor is set with the priority and cpu-affinity options. If, config-child-threads True is set, the DDS threads will also inherit the same priority and CPU affinity configuration than the main thread.

Example using ros2 launch:

ros2 launch pendulum_bringup pendulum_bringup.launch.py priority:=80 cpu-affinity:=4 lock-memory-size:=100 config-child-threads:=True

Example using the executable command line arguments:

ros2 run pendulum_demo pendulum_demo --priority 80 --cpu-affinity:=4 --lock-memory-size 100 --config-child-threads True

Source: https://github.com/ros2-realtime-demo/pendulum/blob/rolling/docs/real_time_tutorial.md