-
Notifications
You must be signed in to change notification settings - Fork 8
Cheatsheet
ssh [email protected]
source ~/ros2_ws/install/local_setup.bash
ros2 launch mep3_bringup robot_launch.py color:=blue namespace:=big bt:=false strategy:=demo
For example, if you are testing the motion then you can turn off the behavior tree (bt:=false
).
You can transfer a local strategy file to the Raspberry Pi:
scp first_strategy.xml [email protected]/home/ubuntu/ros2_ws/src/mep3/mep3_behavior/strategies/big
To execute the strategy run the robot_launch.py
file (ros2 launch mep3_bringup robot_launch.py strategy:=first_strategy ...
).
Alternatively, you can mount the strategy folder:
nautilus sftp://[email protected]/home/ubuntu/ros2_ws/src/mep3/mep3_behavior_tree/strategiesThe command should open Nautilus (a file explorer) with all available strategies.
Given that the strategy executor is a standalone node and the ROS' distributed nature (ROS 2 allows nodes to interact anywhere on a network) we can start the strategy executor independently:
ros2 run mep3_behavior mep3_behavior --ros-args -r __ns:=/big -p strategy:=first_strategy
This should significantly speed up the development process, especially considering that you can start the strategy outside of Raspberry Pi, for example on your PC. Note that you have to start the rest of the ROS stack without the strategy executor on the Raspberry Pi:
ros2 launch mep3_bringup robot_launch.py bt:=false ...
This allows you to access the strategy folder located on the robot from your computer. In the location where you want to mount the directory, execute this commands:
mkdir mbig or mkdir msmall
sshfs ubuntu@<robot IP adress>:/home/ubuntu/ros2_ws/src/mep3/mep3_behavior/strategies/ ~/<the name of the previously created directory>/
sudo apt install avahi-discover
sudo hostnamectl set-hostname $NEW_HOSTNAME
hostnamectl
sudo useradd --create-home $NEW_USERNAME
sudo passwd $NEW_USERNAME
sudo vim /etc/netplan/*.yaml
sudo netplan apply
You don't need a password to login into a Raspberry Pi, you can use a public-private key pair. Append the content of the ~/.ssh/id_rsa.pub
file (host) to the ~/.ssh/authorized_keys
file (Raspberry Pi).
Run a new tmux session
tmux
Attach to latest session
tmux attach
To detach from active session press Ctrl + B
, write :detach
and press Return key.
Attach to session named 0
Name is displayed on the left of the bottom green bar in brackets.
tmux attach-session -t 0
List all running sessions
tmux list-sessions
Save last 10000 lines inside an active session
Press Ctrl + B
and write :capture-pane -S -10000
followed by a Return key.
After that, press Ctrl + B
again and write :save-buffer ~/tmux_session_log.out
and press Return key.
To save all of the lines in the session, replace -10000
with -
.
Save last 10000 lines of an active tmux session named 0
tmux capture-pane -t 1 -pS -10000 > ~/tmux_session_log.out