In general, programming your robot should start on your laptop. Start your Duckietown container as you would for a homework assignment and create any packages, code, or launch files that you think you will need on the robot. You can start all code in your container and send input to it or read output from it manually using rostopic. After you have the first draft of your code, build your container on your robot:
$ dts devel build -H <duckiebot_name>.local --pull
And start your container on the robot:
$ dts devel run -H <duckiebot_name>.local -s -M --cmd bash
The above command will sync your code to the robot (-s) and share it with your container (-M).
As you develop your program, you may need to periodically rebuild your catkin workspace on your robot. If so, use the script below as it uses fewer resources on the Raspberry Pi:
While code can be edited on the robot it is not recommended. Unless you explicitly set it up, your robot does not access to your git repo, so it is difficult to commit changes to GitHub. Instead, change code on your laptop and sync it with your robot using this command:
$ dts devel sync -H <duckiebot_name>.local
This dts command essentially runs the following rsync command. Note that the local path to your repo should NOT contain a slash (/) at the end.
$ rsync --archive <path/to/repo> duckie@<duckiebot>.local:/code/
Debug your robot using:
$ dts start_gui_tools <duckiebot_name>
as described here: https://docs.duckietown.org/daffy/opmanual_duckiebot/out/using_no_vnc.html