Cheat
sheet - most important commands / Ściągawka - najważniejsze komendy

A quick reference of the commands used during the labs. Values in
<angle brackets> are placeholders - replace them with
your own values. The Lab column shows where the command
is explained in detail (RR = Connecting to real
robot).
Szybki przegląd komend używanych na zajęciach. Wartości w
<nawiasach ostrych> to miejsca do uzupełnienia
własnymi wartościami. Kolumna Lab wskazuje, gdzie
komenda jest dokładnie opisana (RR = Connecting to real
robot).
Contents / Spis treści
- Linux terminal /
Terminal Linux
- Files and
directories / Pliki i katalogi
- Text editors / Edytory
tekstu
- Packages (apt) / Pakiety
(apt)
- Remote access / Zdalny
dostęp
- Python
and virtual environments / Python i środowiska wirtualne
- Git
- Docker
- Docker Compose
- FOSSBot
simulation container / Kontener z symulacją FOSSBota
- ROS
2 - workspace and packages / ROS 2 - workspace i paczki
- ROS
2 - nodes, topics and messages / ROS 2 - węzły, tematy i
wiadomości
- ROS
2 - services, actions, parameters, lifecycle / ROS 2 - serwisy, akcje,
parametry, cykl życia
- Simulator
and moving the robot / Symulator i sterowanie robotem
- Visualisation
and debugging / Wizualizacja i debugowanie
- Mapping,
localization and navigation / Mapowanie, lokalizacja i
nawigacja
- Real robot / Prawdziwy
robot
- Keyboard
shortcuts / Skróty klawiszowe
- Typical
workflow / Typowy przebieg pracy
1. Linux terminal / Terminal
Linux
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
pwd |
Print the current (working) directory |
Wyświetla bieżący katalog roboczy |
01 |
ls |
List files in the current directory |
Wyświetla zawartość bieżącego katalogu |
01 |
ls -la |
List all files (also hidden) with details |
Wyświetla wszystkie pliki (także ukryte) ze szczegółami |
01 |
cd <dir> |
Change directory |
Zmienia katalog |
01 |
cd ~ / cd |
Go to your home directory |
Przechodzi do katalogu domowego |
01 |
cd .. |
Go one directory up |
Przechodzi katalog wyżej |
01 |
<command> --help |
Show short help for a command |
Wyświetla krótką pomoc do komendy |
01 |
man <command> |
Open the manual page of a command (q to quit) |
Otwiera stronę podręcznika komendy (q - wyjście) |
01 |
sudo <command> |
Run a command as administrator |
Uruchamia komendę z uprawnieniami administratora |
01 |
sudo !! |
Re-run the previous command with sudo |
Powtarza poprzednią komendę z sudo |
01 |
<cmd1> && <cmd2> |
Run cmd2 only if cmd1 succeeded |
Uruchamia cmd2 tylko, gdy cmd1 zakończyła
się sukcesem |
01 |
<cmd1> ; <cmd2> |
Run cmd2 after cmd1, regardless of the
result |
Uruchamia cmd2 po cmd1 niezależnie od
wyniku |
01 |
<cmd1> \| <cmd2> |
Pass the output of cmd1 as input of cmd2
(pipe) |
Przekazuje wyjście cmd1 na wejście cmd2
(potok) |
01 |
<cmd> \| grep <text> |
Show only lines containing text |
Wyświetla tylko linie zawierające text |
05 |
time <command> |
Measure how long a command runs |
Mierzy czas wykonania komendy |
01 |
ip a |
Show network interfaces and IP addresses |
Wyświetla interfejsy sieciowe i adresy IP |
01 |
ping <ip-or-hostname> |
Check if a machine is reachable over the network |
Sprawdza, czy maszyna jest osiągalna w sieci |
02 |
export <VAR>=<value> |
Set an environment variable in the current terminal |
Ustawia zmienną środowiskową w bieżącym terminalu |
RR |
echo $<VAR> |
Print the value of an environment variable |
Wyświetla wartość zmiennej środowiskowej |
- |
2. Files and directories
/ Pliki i katalogi
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
mkdir <dir> |
Create a directory |
Tworzy katalog |
01 |
mkdir -p <a/b/c> |
Create nested directories (no error if they exist) |
Tworzy zagnieżdżone katalogi (bez błędu, jeśli istnieją) |
04, 09 |
touch <file> |
Create an empty file (or update its timestamp) |
Tworzy pusty plik (lub aktualizuje jego datę) |
01 |
cp <src> <dst> |
Copy a file |
Kopiuje plik |
01 |
cp -r <src> <dst> |
Copy a directory recursively |
Kopiuje katalog rekurencyjnie |
01 |
mv <src> <dst> |
Move or rename a file/directory |
Przenosi lub zmienia nazwę pliku/katalogu |
01 |
rm <file> |
Delete a file |
Usuwa plik |
01 |
rm -r <dir> |
Delete a directory with its content |
Usuwa katalog wraz z zawartością |
01 |
rm -rf <dir> |
Force delete without asking - be careful! |
Wymusza usunięcie bez pytania - ostrożnie! |
01 |
cat <file> |
Print the content of a file |
Wyświetla zawartość pliku |
01, 04 |
head -n 10 <file> |
Print the first 10 lines of a file |
Wyświetla pierwsze 10 linii pliku |
04 |
tree <dir> |
Show the directory structure as a tree |
Wyświetla strukturę katalogów jako drzewo |
01 |
*.txt, [0-9]* |
Wildcards - match many files at once |
Symbole wieloznaczne - dopasowują wiele plików naraz |
01 |
chmod +x <file> |
Make a file executable |
Nadaje plikowi prawo do uruchamiania |
- |
3. Text editors / Edytory
tekstu
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
nano <file> |
Open a file in the simple nano editor |
Otwiera plik w prostym edytorze nano |
01 |
Ctrl+O, Enter (nano) |
Save the file |
Zapisuje plik |
01 |
Ctrl+X (nano) |
Exit nano |
Zamyka nano |
01 |
vim <file> |
Open a file in the vim editor |
Otwiera plik w edytorze vim |
01 |
i (vim) |
Enter insert (editing) mode |
Włącza tryb wstawiania (edycji) |
01 |
Esc (vim) |
Go back to normal mode |
Wraca do trybu normalnego |
01 |
:wq (vim) |
Save and quit |
Zapisuje i wychodzi |
01 |
:q! (vim) |
Quit without saving |
Wychodzi bez zapisywania |
01 |
code . |
Open the current directory in VS Code |
Otwiera bieżący katalog w VS Code |
02, 04 |
4. Packages (apt) / Pakiety (apt)
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
sudo apt update |
Refresh the list of available packages |
Odświeża listę dostępnych pakietów |
01 |
apt search <keyword> |
Search for a package |
Wyszukuje pakiet |
01 |
sudo apt install <package> |
Install a package |
Instaluje pakiet |
01 |
sudo apt remove <package> |
Uninstall a package |
Odinstalowuje pakiet |
01 |
5. Remote access / Zdalny
dostęp
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
ssh <user>@<ip> |
Log in to a remote machine |
Loguje się na zdalną maszynę |
01 |
exit |
Close the remote session (or the current shell) |
Zamyka sesję zdalną (lub bieżącą powłokę) |
01 |
scp <file> <user>@<ip>:~/ |
Upload a file to a remote machine |
Wysyła plik na zdalną maszynę |
01 |
scp -r <dir> <user>@<ip>:~/ |
Upload a whole directory |
Wysyła cały katalog |
01 |
scp <user>@<ip>:~/<file> ./ |
Download a file from a remote machine |
Pobiera plik ze zdalnej maszyny |
01 |
rsync -PHAXphax <src> <user>@<ip>:<dst> |
Synchronise files (resumable, keeps permissions) |
Synchronizuje pliki (wznawialnie, zachowuje uprawnienia) |
01 |
sudo systemctl poweroff |
Shut down the machine |
Wyłącza maszynę |
01 |
6.
Python and virtual environments / Python i środowiska wirtualne
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
python3 --version |
Check the installed Python version |
Sprawdza zainstalowaną wersję Pythona |
02 |
python3 <script.py> |
Run a Python script |
Uruchamia skrypt Pythona |
02 |
python3 -m venv <env-name> |
Create a virtual environment |
Tworzy środowisko wirtualne |
02, 03 |
source <env-name>/bin/activate |
Activate the virtual environment |
Aktywuje środowisko wirtualne |
02, 03 |
deactivate |
Leave the virtual environment |
Wychodzi ze środowiska wirtualnego |
03 |
pip install <package> |
Install a Python package |
Instaluje paczkę Pythona |
02 |
pip install <package>==<version> |
Install a specific version of a package |
Instaluje konkretną wersję paczki |
02 |
pip install -r requirements.txt |
Install all packages listed in a file |
Instaluje wszystkie paczki z pliku |
03 |
python -c "import <pkg>; print('OK')" |
Quickly check that a package can be imported |
Szybko sprawdza, czy paczkę da się zaimportować |
03 |
python -m <module> |
Run a module (e.g. python -m src.text_to_wheels) |
Uruchamia moduł (np. python -m src.text_to_wheels) |
03, 04 |
7. Git
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
git clone <url> |
Download a repository |
Pobiera repozytorium |
03-13 |
git clone <url> <dir> |
Download a repository into a chosen directory |
Pobiera repozytorium do wskazanego katalogu |
03 |
git pull |
Download the newest changes of an already cloned repository |
Pobiera najnowsze zmiany do już sklonowanego repozytorium |
- |
git status |
Show changed files |
Wyświetla zmienione pliki |
- |
8. Docker
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
docker --version, docker info |
Check that Docker is installed and running |
Sprawdza, czy Docker jest zainstalowany i działa |
04 |
docker run hello-world |
Run a test container |
Uruchamia kontener testowy |
04 |
docker run -it --rm <image> bash |
Start an interactive container, delete it after exit |
Uruchamia interaktywny kontener, usuwany po wyjściu |
04 |
docker run -d --name <name> -p <host>:<cont> <image> |
Run a container in the background with a port mapping |
Uruchamia kontener w tle z przekierowaniem portu |
04 |
docker run -v <host-dir>:<cont-dir> ... |
Mount a host directory inside the container |
Montuje katalog hosta wewnątrz kontenera |
04 |
docker run --gpus all ... |
Give the container access to NVIDIA GPUs |
Daje kontenerowi dostęp do kart NVIDIA |
04 |
docker ps |
List running containers |
Wyświetla uruchomione kontenery |
04 |
docker ps -a |
List all containers (also stopped) |
Wyświetla wszystkie kontenery (także zatrzymane) |
04 |
docker exec -it <name> bash |
Open a new shell in a running container |
Otwiera nową powłokę w działającym kontenerze |
04, 05 |
docker stop <name> |
Stop a container |
Zatrzymuje kontener |
04 |
docker rm <name> |
Remove a stopped container |
Usuwa zatrzymany kontener |
04 |
docker rm -f <name> |
Force-remove a container (also running) |
Wymusza usunięcie kontenera (także działającego) |
04 |
docker build -t <name>:<tag> . |
Build an image from the Dockerfile in the current
directory |
Buduje obraz z Dockerfile w bieżącym katalogu |
04 |
docker images |
List images |
Wyświetla obrazy |
04 |
docker history <image> |
Show the layers of an image |
Wyświetla warstwy obrazu |
04 |
docker image rm <image> |
Remove an image |
Usuwa obraz |
04 |
docker volume create <name> / ls /
inspect / rm |
Manage named volumes |
Zarządza nazwanymi wolumenami |
04 |
docker save <image> \| ssh <user>@<ip> docker load |
Copy an image to another machine (e.g. the robot) |
Kopiuje obraz na inną maszynę (np. robota) |
04 |
9. Docker Compose
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
docker compose up |
Start all services from docker-compose.yml |
Uruchamia wszystkie usługi z docker-compose.yml |
04 |
docker compose ps / ps -a |
List the services of the project |
Wyświetla usługi projektu |
04 |
docker compose down |
Stop and remove the services |
Zatrzymuje i usuwa usługi |
04 |
docker compose down --volumes |
Same as above and also remove the volumes |
Jak wyżej, dodatkowo usuwa wolumeny |
04 |
10.
FOSSBot simulation container / Kontener z symulacją FOSSBota
Run these on the host (your workstation), inside the
cloned FOSSBotEduSim directory.
Uruchamiaj na hoście (swoim komputerze), w
sklonowanym katalogu FOSSBotEduSim.
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
git clone https://github.com/LRMPUT/FOSSBotEduSim.git |
Download the simulator repository |
Pobiera repozytorium symulatora |
05 |
bash build_image.sh |
Build the ros2_fossbot_edu image (first time 15-25
min) |
Buduje obraz ros2_fossbot_edu (za pierwszym razem 15-25
min) |
05 |
bash start_container.sh |
Start the container (with NVIDIA GPU) |
Uruchamia kontener (z kartą NVIDIA) |
05 |
bash start_container_no_gpus.sh |
Start the container on a machine without NVIDIA GPU |
Uruchamia kontener na komputerze bez karty NVIDIA |
05 |
docker exec -it ros2_fossbot_edu bash |
Open another terminal in the running container |
Otwiera kolejny terminal w działającym
kontenerze |
05 |
bash run_nav.sh |
Start the container + simulator + Nav2 + RViz at once |
Uruchamia naraz kontener + symulator + Nav2 + RViz |
13 |
xhost +SI:localuser:$(id -un) |
Allow containers to open windows on your screen |
Pozwala kontenerom otwierać okna na Twoim ekranie |
08 |
Tip / Wskazówka: The container is started with
--rm - it is deleted after you exit. Only files in
ws_fossbot/ (mounted from the host) are kept. / Kontener
startuje z --rm - po wyjściu jest usuwany. Zachowywane są
tylko pliki w ws_fossbot/ (zamontowanym z hosta).
11.
ROS 2 - workspace and packages / ROS 2 - workspace i paczki
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
source /opt/ros/jazzy/setup.bash |
Load ROS 2 into the terminal (not needed in the container) |
Ładuje ROS 2 do terminala (niepotrzebne w kontenerze) |
07 |
cd /fossbot_ros2/ws_fossbot |
Go to the workspace root (inside the container) |
Przechodzi do katalogu głównego workspace’a (w kontenerze) |
05 |
ros2 pkg create --build-type ament_python <pkg> |
Create a new Python package (run in ws/src) |
Tworzy nową paczkę w Pythonie (uruchom w ws/src) |
07 |
ros2 pkg create --build-type ament_python --node-name <node> <pkg> |
Create a Python package with a sample node |
Tworzy paczkę w Pythonie z przykładowym węzłem |
07, 08 |
ros2 pkg create ... --dependencies rclpy sensor_msgs |
Create a package with dependencies |
Tworzy paczkę z zależnościami |
09 |
ros2 pkg create --build-type ament_cmake <pkg> |
Create a CMake package (e.g. for custom msg/srv/action) |
Tworzy paczkę CMake (np. na własne msg/srv/action) |
09, 10 |
colcon build |
Build the whole workspace (run in the workspace root!) |
Buduje cały workspace (uruchom w katalogu głównym workspace’a!) |
05, 07 |
colcon build --packages-select <pkg1> <pkg2> |
Build only selected packages |
Buduje tylko wybrane paczki |
07 |
colcon build --symlink-install |
Build so that Python changes are visible without rebuilding |
Buduje tak, aby zmiany w Pythonie były widoczne bez
przebudowania |
10, 11 |
source install/setup.bash |
Load the built workspace - after every build, in every
terminal |
Ładuje zbudowany workspace - po każdym buildzie, w każdym
terminalu |
05, 07 |
ros2 pkg list \| grep <text> |
Find an installed package |
Wyszukuje zainstalowaną paczkę |
05 |
12.
ROS 2 - nodes, topics and messages / ROS 2 - węzły, tematy i
wiadomości
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
ros2 run <pkg> <executable> |
Run a node |
Uruchamia węzeł |
05 |
ros2 launch <pkg> <launch_file> |
Start a launch file (many nodes at once) |
Uruchamia plik launch (wiele węzłów naraz) |
05, 07 |
ros2 node list |
List running nodes |
Wyświetla uruchomione węzły |
05 |
ros2 node info <node> |
Show the topics/services of a node |
Wyświetla tematy/serwisy węzła |
05 |
ros2 topic list |
List all topics |
Wyświetla wszystkie tematy |
05 |
ros2 topic list -t |
List topics with their message types |
Wyświetla tematy z typami wiadomości |
05 |
ros2 topic info <topic> |
Show the type, publishers and subscribers of a topic |
Wyświetla typ, nadawców i odbiorców tematu |
05 |
ros2 topic echo <topic> |
Print messages as they arrive (Ctrl+C to stop) |
Wyświetla przychodzące wiadomości (Ctrl+C - stop) |
05 |
ros2 topic echo <topic> --once |
Print a single message |
Wyświetla jedną wiadomość |
05, 06 |
ros2 topic echo <topic> --once --field header |
Print only one field of a message |
Wyświetla tylko jedno pole wiadomości |
12 |
ros2 topic hz <topic> |
Measure the publishing rate |
Mierzy częstotliwość publikowania |
05 |
ros2 topic pub --once <topic> <type> "<data>" |
Publish one message |
Publikuje jedną wiadomość |
06 |
ros2 topic pub --rate 10 <topic> <type> "<data>" |
Publish a message 10 times per second |
Publikuje wiadomość 10 razy na sekundę |
06 |
ros2 interface show <type> |
Show the structure of a msg/srv/action type |
Wyświetla strukturę typu msg/srv/action |
05, 07 |
Common message types / Często używane typy:
geometry_msgs/msg/Twist (/cmd_vel),
sensor_msgs/msg/LaserScan (/scan),
nav_msgs/msg/Odometry (/odom),
std_msgs/msg/String.
13.
ROS 2 - services, actions, parameters, lifecycle / ROS 2 - serwisy,
akcje, parametry, cykl życia
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
ros2 service list |
List available services |
Wyświetla dostępne serwisy |
10 |
ros2 service call <srv> <type> "<request>" |
Call a service |
Wywołuje serwis |
10, RR |
ros2 action send_goal <action> <type> "<goal>" --feedback |
Send a goal to an action server and show feedback |
Wysyła cel do serwera akcji i wyświetla informację zwrotną |
09 |
ros2 run <pkg> <exe> --ros-args -p <name>:=<value> |
Run a node with a parameter value |
Uruchamia węzeł z wartością parametru |
07, 11 |
ros2 run <pkg> <exe> --ros-args --params-file <file.yaml> |
Run a node with parameters from a YAML file |
Uruchamia węzeł z parametrami z pliku YAML |
11 |
ros2 run <pkg> <exe> --ros-args -r <from>:=<to> |
Remap a topic name |
Zmienia (przemapowuje) nazwę tematu |
11 |
ros2 launch <pkg> <file> <arg>:=<value> |
Pass an argument to a launch file |
Przekazuje argument do pliku launch |
05, 10 |
ros2 lifecycle set <node> configure |
Configure a lifecycle node |
Konfiguruje węzeł z cyklem życia |
11 |
ros2 lifecycle set <node> activate |
Activate a lifecycle node |
Aktywuje węzeł z cyklem życia |
11 |
14.
Simulator and moving the robot / Symulator i sterowanie robotem
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
ros2 launch fossbot_educational_description single.launch.py world:=<world>.sdf |
Start Gazebo + RViz with the FOSSBot in the chosen world |
Uruchamia Gazebo + RViz z FOSSBotem w wybranym świecie |
05-12 |
ros2 run teleop_twist_keyboard teleop_twist_keyboard |
Drive the robot with the keyboard (i, j,
l, ,, k - stop) |
Steruje robotem z klawiatury (i, j,
l, ,, k - stop) |
05, 06 |
ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.2}, angular: {z: 0.0}}" |
Drive forward |
Jazda do przodu |
06 |
ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0}, angular: {z: 0.5}}" |
Rotate in place |
Obrót w miejscu |
06 |
ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist "{}" |
Stop the robot (all velocities = 0) |
Zatrzymuje robota (wszystkie prędkości = 0) |
06 |
ros2 run fossbot_educational_description random_spawner |
Spawn random objects in the world |
Dodaje losowe obiekty do świata |
09 |
Worlds used in the labs / Światy używane na zajęciach:
simple_shapes.sdf, single_wall.sdf,
sample_rooms.sdf,
world_for_object_detection.sdf.
15.
Visualisation and debugging / Wizualizacja i debugowanie
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
rqt_graph |
Show the graph of nodes and topics |
Wyświetla graf węzłów i tematów |
05, 06 |
rviz2 |
Start RViz (3D visualisation of robot data) |
Uruchamia RViz (wizualizacja 3D danych robota) |
- |
ros2 run tf2_tools view_frames |
Save the TF tree (coordinate frames) to a PDF |
Zapisuje drzewo TF (układy współrzędnych) do PDF |
11 |
16.
Mapping, localization and navigation / Mapowanie, lokalizacja i
nawigacja
| Command / Komenda |
Description (EN) |
Opis (PL) |
Lab |
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=true |
Start SLAM in the simulator |
Uruchamia SLAM w symulatorze |
10, 12 |
ros2 launch slam_toolbox online_async_launch.py use_sim_time:=false |
Start SLAM on the real robot |
Uruchamia SLAM na prawdziwym robocie |
12 |
ros2 run nav2_map_server map_saver_cli -f <path/map_name> |
Save the current map (.pgm + .yaml) |
Zapisuje bieżącą mapę (.pgm + .yaml) |
10, 12 |
ros2 run nav2_map_server map_server --ros-args -p yaml_filename:=<map.yaml> -p use_sim_time:=true |
Serve a saved map (then configure +
activate) |
Udostępnia zapisaną mapę (potem configure +
activate) |
11 |
ros2 run nav2_amcl amcl --ros-args --params-file <amcl.yaml> |
Start AMCL localization (then configure +
activate) |
Uruchamia lokalizację AMCL (potem configure +
activate) |
11 |
ros2 topic echo /amcl_pose |
Print the estimated robot pose |
Wyświetla estymowaną pozycję robota |
11 |
ros2 launch fossbot_educational_navigation navigation.launch.py map:=<map.yaml> use_sim_time:=false |
Start Nav2 with a given map (real robot) |
Uruchamia Nav2 z podaną mapą (prawdziwy robot) |
13 |
Tip / Wskazówka: use_sim_time:=true in
the simulator, use_sim_time:=false on the real robot. /
use_sim_time:=true w symulatorze,
use_sim_time:=false na prawdziwym robocie.
17. Real robot / Prawdziwy
robot
Details: Connecting to
real robot. / Szczegóły: Connecting to real
robot.
| Command / Komenda |
Description (EN) |
Opis (PL) |
git clone https://github.com/LRMPUT/fossbot-ros2-bridge.git |
Download the bridge (once per workstation) |
Pobiera bridge (raz na stanowisko) |
ROS_DOMAIN_ID=<N> FOSSBOT_MDNS=1 FOSSBOT_HOST=fossbotrpi<N>.local ./run.sh |
Start the bridge container for robot N |
Uruchamia kontener bridge dla robota N |
ros2 launch fossbot_bridge bringup.launch.py |
Start the bridge (inside the bridge container, keep it open) |
Uruchamia bridge (w kontenerze bridge, nie zamykaj terminala) |
export ROS_DOMAIN_ID=<N> |
Select your robot - in every terminal |
Wybiera Twojego robota - w każdym terminalu |
ros2 daemon stop ; ros2 daemon start |
Restart ROS 2 discovery after changing
ROS_DOMAIN_ID |
Restartuje wykrywanie ROS 2 po zmianie
ROS_DOMAIN_ID |
ros2 topic echo /fossbot/link_status --once |
Check the connection with the robot
(connected: true) |
Sprawdza połączenie z robotem (connected: true) |
ros2 service call /fossbot/enable_motors std_srvs/srv/SetBool "{data: true}" |
Enable the motors (they start disabled) |
Włącza silniki (domyślnie są wyłączone) |
ros2 service call /fossbot/enable_motors std_srvs/srv/SetBool "{data: false}" |
Disable the motors |
Wyłącza silniki |
ros2 topic echo /fossbot/battery --once |
Check the battery voltage (below ~4.7 V = low) |
Sprawdza napięcie baterii (poniżej ~4,7 V = niskie) |
docker exec -it fossbot_bridge bash -lc 'source /ws/install/setup.bash && ros2 run fossbot_bridge teleop' |
Keyboard driving (e - enable,
w/a/s/d -
drive) |
Sterowanie z klawiatury (e - włącz,
w/a/s/d -
jazda) |
Warning / Uwaga: Only one
workstation may run the bridge for a given robot. Do
not launch the simulator when working with the real
robot. / Tylko jedno stanowisko może uruchomić bridge
dla danego robota. Nie uruchamiaj symulatora podczas
pracy z prawdziwym robotem.
18. Keyboard shortcuts /
Skróty klawiszowe
| Shortcut / Skrót |
Description (EN) |
Opis (PL) |
Tab |
Autocomplete a command, path or ROS name (press twice to see
options) |
Autouzupełnianie komendy, ścieżki lub nazwy ROS (dwa razy - lista
opcji) |
↑ / ↓ |
Browse previous commands |
Przeglądanie poprzednich komend |
Ctrl+R |
Search the command history |
Wyszukiwanie w historii komend |
Ctrl+C |
Stop the running program/node |
Zatrzymuje uruchomiony program/węzeł |
Ctrl+D |
Exit the shell (like exit) |
Wychodzi z powłoki (jak exit) |
Ctrl+L |
Clear the terminal |
Czyści terminal |
Ctrl+Shift+C / Ctrl+Shift+V |
Copy / paste in the terminal |
Kopiuj / wklej w terminalu |
Ctrl+Shift+T |
Open a new terminal tab |
Otwiera nową kartę terminala |
19. Typical workflow /
Typowy przebieg pracy
A typical simulation session / Typowa sesja z symulacją:
# Terminal 1 (host): start the container / uruchom kontener
cd FOSSBotEduSim
bash start_container.sh # or / lub: bash start_container_no_gpus.sh
# Terminal 1 (container): build and start the simulator / zbuduj i uruchom symulator
cd /fossbot_ros2/ws_fossbot
colcon build --packages-select <your_pkg>
source install/setup.bash
ros2 launch fossbot_educational_description single.launch.py world:=simple_shapes.sdf
# Terminal 2 (host): open another shell in the same container / kolejna powłoka w tym samym kontenerze
docker exec -it ros2_fossbot_edu bash
source /fossbot_ros2/ws_fossbot/install/setup.bash
ros2 run <your_pkg> <your_node>
Common mistakes / Częste błędy:
Package '<pkg>' not found - you
forgot source install/setup.bash after building (in this
terminal). / Zapomniano o source install/setup.bash po
zbudowaniu (w tym terminalu).
colcon build creates build/,
install/, log/ in a wrong place -
always run it in the workspace root
(/fossbot_ros2/ws_fossbot), not in src/. /
Zawsze uruchamiaj w katalogu głównym workspace’a
(/fossbot_ros2/ws_fossbot), a nie w src/.
ros2 topic list shows only
/parameter_events and /rosout - the
simulator (or bridge) is not running, or ROS_DOMAIN_ID
differs between terminals. / Symulator (lub bridge) nie działa albo
ROS_DOMAIN_ID różni się między terminalami.
- Files disappeared after restarting the container -
only
ws_fossbot/ is kept on the host. / Zachowywany jest
tylko katalog ws_fossbot/ na hoście.
- The robot keeps moving - stop the publisher with
Ctrl+C and send a zero Twist (see section 14).
/ Zatrzymaj nadawcę Ctrl+C i wyślij zerowy
Twist (patrz sekcja 14).
The Creative Commons Attribution 4.0 International (CC BY 4.0)
license allows users to share, copy, distribute, and adapt the work,
even for commercial purposes, as long as proper credit is given to the
original creator.
EU funding disclaimer
Funded by the European Union. Views and opinions expressed are
however those of the author(s) only and do not necessarily reflect those
of the European Union or the European Education and Culture Executive
Agency (EACEA). Neither the European Union nor EACEA can be held
responsible for them.