Enable learning low-level robot control in ROS without needing to do any embedded programming
(even though, outside an educational context, it makes sense to perform the conversion between say cmd_vel
messages and
wheel velocities directly on the OpenCR embedded microcontroller, as is the default for ROBOTIS).
- Scripts for building a raspberrypi 3 Ubuntu image for use with the turtlebot
- Contains all ROS packages for running the turtlebot3
- Ability to switch between original OpenCR firmware and custom raw firmware
- Custom Raw firmware enables ROS access to raw sensor data (e.g., encoder ticks) and direct motor control of wheel velocities
- Scripts for building turtlebot3 OpenCR firmware (and modified versions) from the command line
- Uses the Arduino CLI interface to build OpenCR firmware, from a custom fork of that firmware
- Docker container for cross-compiling programs that run on the Raspberry PI
- Install docker and pre-requisites:
sudo apt install docker.io
- In the base of the ROS workspace run:
docker run reem17/rosberrypi:noetic > arm && chmod 755 arm
- To build with
catkin_make
for arm use./arm catkin_arm
- To build with
catkin_make_isolated
for arm use./arm catkin_arm_isolated
These instructions explain how to build a custom SDCard image for the turtlebot3. You need to be root to do this. It is a TODO to lower the permission requirements If your turtlebot3 is already set up, you need not run these commands
-
Install the prequisites:
apt install qemu-user-static binfmt-support xz-utils
-
Run scripts/create_image to create the basic image.
- Can be run as
rosrun nuturtlebot create_image
and will create a file (relative to the current directory) calledbuild/turtlebot_image/turtlebot.img
that can be written to the SD card. - This script automatically builds both versions of the OpenCr firmware
- Can be run as
-
After writing the image to the SDcard, the raspberry pi should boot and connect to the network. ssh into the raspberry pi, then run
opencr_update stock
to install the stock firmware oropencr_update raw
to install the low-level firmware -
If your turtlebot3 has not yet been setup, run scripts/write_image to write the image to the sd_card
- This script allows each image written to be customized for a specific robot
- Should be invoked as
rosrun nuturtlebot write_image <sdcard> <name> <pubkey> <nmcon> [robotdns]
<sdcard>
: Path to the sdcard device (e.g./dev/mmcblk0
)<name>
: The hostname for the turtlebot. Each turtlebot on your network should have a unique hostname<pubkey>
: An ssh public key that will let the people with the corresponding private key to logon as themsr
user<nmcon>
: A network-manager connection file, corresponding to the network the turtlebot should connect to.- Can specify the full path or will search for a file called
/etc/NetworkManager/system-connections/<nmcon>.nmconnection
- If you are connected to the same wifi network you want to use, can usually be the SSID of that network. The profile will be written to the SDCard in a way that will work with the target hardware.
- Computer-specific parts of the file will stripped from the connection profile prior to installation on the turtlebot
- Can specify the full path or will search for a file called
<robotdns>
(optional): The robotdns server location, if being used.- robotdns is a dynamic DNS server enabling robots to communicate via hostnames even when we do not control the LAN settings (e.g., are on a corporate network).
- For this option to work, the
<nmcon>
must be a network profile created by the robotdns setup and be namednetwork.robot.nmconnection
.
-
Log into the turtlebot and install the firmware with either
opencr_update stock
oropencr_update raw
(see below).
These are instructions for how to build the firmware, which is automatically done when building the SDCard image, but can be done separately.
If your turtlebot3 is already set up, you need not run these commands
- Clone the repository into a workspace
- Install the dependencies:
rosdep --install --from-paths src --ignore-src -r -y
- Build the workspace (
catkin_make
orcatkin build
,catkin_make_isolated
is not supported currently) rosrun nuturtlebot build_firmware
- This command will download arduino-cli tools and build both the stock firmware and the raw firmware
- The stock firmware is stored in
build/opencr/burger.opencr
(Put it on the turtlebot3 at/usr/share/opencr
) - The raw firmware is stored in
build/opencr/raw-burger.opencr
(Put it on the turtlebot3 at/usr/share/opencr
- The firmware loader (to be run on the turtlebot) is in
build/opencr/opencr_ld_shell
(Put it on the turtlebot3 at/usr/bin
). - The firmware update wrapping script is in
build/opencr/opencr_update
(Put in on the turtlebot3 at/usr/bin
) - Use
opencr_update stock
on the turtlebot3 to install stock firmware andopencr_update raw
to install the raw firmware
- The Docker Cross-compile image is a docker image that is based off of the raspberry pi image.
- The libraries on the docker cross-compile image are therefore the same as those on the raspberry pi
- However, the dockerfile replaces several armhf binaries with amd64 binaries and installs a cross compiler
- First, build the turtlebot image
- Then, run
./scripts/docker_build