Modifying Pupper code
Source code
All of the software running on the Pi is available here: pupperv3-monorepo.
On the robot, the pupperv3-monorepo code is located at ~/pupperv3-monorepo.
The ROS2 workspace is located at ~/pupperv3-monorepo/ros2_ws.
Editing code on the robot
Steps
SSH to Pupper with:
ssh pi@pupper.local
If you want to use Foxglove for visualization instead run:
ssh -LA 8765:localhost:8765 pi@pupper.local
Troubleshooting [1]
Enable SSH without password (super convenient!) [2]
Disable the stack from running on boot (one-time step):
sudo systemctl disable robot
Set correct permissions (one-time step):
sudo chown -R pi /home/pi
Modify code (see below for examples)
Build code:
cd ~/pupperv3-monorepo/ros2_ws ./build.sh
Launch stack:
ros2 launch neural_controller launch.py
Examples
Train a new RL policy
Train a different policy using our colab here.
Download the resulting .json policy file from the Weights and Biases run generated by the colab and put it in
neural_controller/launchUpdate the
model_pathfield inside the config file located atneural_controller/launch/config.yamlto point to the new policy file.Build the code with
./build.sh.Simulate your code with
ros2 launch neural_controller launch.py sim:=True. A Mujoco simulation window should pop up on the screen or attached monitor.Run the code on the physical hardware with
ros2 launch neural_controller launch.py.
Add a new controller to control pupper movement
Make a new ROS2 package in
~/pupperv3-monorepo/ros2_ws/src.Write a node that publishes Twist messages to the
/cmd_veltopic.Update the
neural_controller/launch/launch.pyfile to include your new node and possibly disable the joystick twist publisher if the messages would conflict.Build the code with
./build.sh.Simulate your code with
ros2 launch neural_controller launch.py sim:=True. A Mujoco simulation window should pop up on the screen or attached monitor.Run the code on the physical hardware with
ros2 launch neural_controller launch.py.
Footnotes