A Viam-powered Yahboom DOFBOT arm. Get started quickly with this codelab!
Coming soon!
The Raspberry Pi boots from a microSD card. You need to install Raspberry Pi OS on a microSD card that you will use with your Pi. For more details about alternative methods of setting up your Raspberry Pi, refer to the Viam docs.
echo
.pi
(not recommended for security reasons). Also specify a password.viam-server
wirelessly.YES
to apply OS customization settings. Confirm YES
to erase data on the microSD card. You may also be prompted by your operating system to enter an administrator password. ssh <USERNAME>@<HOSTNAME>.local
# for example, my command would look like this:
ssh atacke@echo.local
sudo apt update
sudo apt upgrade
sudo raspi-config
sudo reboot
viam-server
on your device, select Linux/Aarch64
. Leave the default installation method of viam-agent
: With a machine configured, we now need to configure the arm's components next!
This approach will walk you through the JSON configuration of the dofbot components you'll need to configure. You'll primarily work within the JSON editor of your machine.
{} JSON
tab to open the machine's JSON configuration page. {
"components": [
{
"name": "dofbot-camera",
"api": "rdk:component:camera",
"model": "rdk:builtin:ffmpeg",
"attributes": {
"video_path": "/dev/video0"
}
},
{
"name": "dofbot-arm",
"api": "rdk:component:arm",
"model": "hipsterbrown:dofbot:arm",
"attributes": {},
"frame": {
"parent": "world",
"translation": {
"x": 0,
"y": 0,
"z": 0
},
"orientation": {
"type": "ov_degrees",
"value": {
"x": 0,
"y": 0,
"z": 1,
"th": 0
}
}
}
},
{
"name": "dofbot-gripper",
"api": "rdk:component:gripper",
"model": "hipsterbrown:dofbot:gripper",
"attributes": {},
"frame": {
"parent": "dofbot-arm",
"translation": {
"x": 0,
"y": 0,
"z": 0
},
"orientation": {
"type": "ov_degrees",
"value": {
"x": 0,
"y": 0,
"z": 1,
"th": 0
}
}
}
}
],
"modules": [
{
"type": "registry",
"name": "hipsterbrown_dofbot",
"module_id": "hipsterbrown:dofbot",
"version": "latest"
}
]
}
dofbot-camera
), one for the arm (dofbot-arm
), and one for the gripper (dofbot-gripper
):{
"components": [
{
"name": "dofbot-camera",
"api": "rdk:component:camera",
"model": "rdk:builtin:ffmpeg",
"attributes": {
"video_path": "/dev/video0"
}
},
{
"name": "dofbot-arm",
"api": "rdk:component:arm",
"model": "hipsterbrown:dofbot:arm",
"attributes": {},
"frame": {
"parent": "world",
"translation": {
"x": 0,
"y": 0,
"z": 0
},
"orientation": {
"type": "ov_degrees",
"value": {
"x": 0,
"y": 0,
"z": 1,
"th": 0
}
}
}
},
{
"name": "dofbot-gripper",
"api": "rdk:component:gripper",
"model": "hipsterbrown:dofbot:gripper",
"attributes": {},
"frame": {
"parent": "dofbot-arm",
"translation": {
"x": 0,
"y": 0,
"z": 0
},
"orientation": {
"type": "ov_degrees",
"value": {
"x": 0,
"y": 0,
"z": 1,
"th": 0
}
}
}
}
],
rdk:builtin:ffmpeg
model, rdk:component:camera
api, and has a video_path
attribute that points to the default location for cameras on Raspberry Pis. {
"name": "dofbot-camera",
"api": "rdk:component:camera",
"model": "rdk:builtin:ffmpeg",
"attributes": {
"video_path": "/dev/video0"
}
},
rdk:component:arm
and model hipsterbrown:dofbot:arm
as well as a frame
attribute. This represents a coordinate system that describes the position and orientation of the arm within the machine's spatial environment. For now, this is a single, default frame added to the arm. {
"name": "dofbot-arm",
"api": "rdk:component:arm",
"model": "hipsterbrown:dofbot:arm",
"attributes": {},
"frame": {
"parent": "world",
"translation": {
"x": 0,
"y": 0,
"z": 0
},
"orientation": {
"type": "ov_degrees",
"value": {
"x": 0,
"y": 0,
"z": 1,
"th": 0
}
}
}
}
frame
attribute for the gripper: it's parent is now the arm, rather than the world. {
"name": "dofbot-gripper",
"api": "rdk:component:gripper",
"model": "hipsterbrown:dofbot:gripper",
"attributes": {},
"frame": {
"parent": "dofbot-arm",
"translation": {
"x": 0,
"y": 0,
"z": 0
},
"orientation": {
"type": "ov_degrees",
"value": {
"x": 0,
"y": 0,
"z": 1,
"th": 0
}
}
}
}
version
of the module to use as well. For now, we have a single module, the hipsterbrown_dofbot
module which allows us to seamlessly integrate with the dofbot arm in Viam: "modules": [
{
"type": "registry",
"name": "hipsterbrown_dofbot",
"module_id": "hipsterbrown:dofbot",
"version": "latest"
}
]
Great, you've configured your machine via JSON! Skip ahead to the Test your arm step.
This step accomplishes the same tasks as the last step, but in a beginner-friendly, visual manner. If you've already completed the previous step Configure your dofbot (JSON-approach), please skip ahead to Test your arm! Otherwise, you will duplicate components in your machine.
camera
, and find the ffmpeg
module. dofbot-camera
, then click Create. This adds the module for working with the default camera that comes with the Yahboom Dofbot. dofbot-camera
. You'll see a collapsible card on the right, where you can configure the camera component, and the corresponding dofbot-camera
part listed in the left sidebar. video_path
of the intended device needs to be set. You can quickly find which devices are connected to your machine by adding a discovery service. Click Add webcam discovery service that appears in the prompt. discovery-1
service and find-webcams
module to your machine in the left sidebar. Corresponding cards to these items also appear on the right. (If you don't see the prompt in the previous step, you can always manually add the find-webcams
module to your machine by searching for it through the + icon, selecting Component or service, then searching for find-webcams
. Don't forget to click Save)discovery-1
card. Here, you'll find attributes of all discoverable cameras connected to your machine. Find the video_path
of the device you'd like to use as your webcam, then copy the value. For example, I'll use the detected camera from the dofbot, so I'll copy /dev/video0
.video_path
value into your camera component's video_path
input, which is in the Attributes section: Great, your machine now has eyes! Let's add the arm next.
dofbot :arm
module and select it. dofbot-arm
, then click Create. This adds the module for working with the Dofbot's arm, particularly its joints. dofbot-arm
. You'll see a collapsible card on the right, where you can configure the arm component, see any errors originating from the component, and test the component directly, and the corresponding dofbot-arm
part listed in the left sidebar. We now have a connection to the arm (and its joints). Last thing to add is the gripper.
dofbot :gripper
module and select it. dofbot-gripper
, then click Create. This adds the module for working with the Dofbot's gripper, particularly its joints. dofbot-gripper
. You'll see a collapsible card on the right, where you can configure the gripper component, see any errors originating from the component, and test the component directly, and the corresponding dofbot-gripper
part listed in the left sidebar. parent
key, change the value to the name of your arm, so dofbot-arm
: Now that all of your dofbot arm's components are configured in Viam, it's time to test them out.
MoveToJointPositions
panel. For example, to move joint 0 (the lowest on the arm), change the angle for joint 0's input, the press Execute. To test the top-most joint (in our case, where the gripper is mounted), change the angle for joint 4, then press Execute: MoveToPosition
panel. For example, to move the arm forward and backward (relative to its orientation in the world and known coordinate system), change the Y
input value, then press Execute. To move the arm up, change the Z
input value to a higher number. To move it back down, change the Z
input value to a lower number. To test the rotation of the wrist, try changing the θ
's input value: Congratulations! You now have a working Yahboom Dofbot arm connected to Viam.
Congratulations! You've just connected your Yahboom DOFBOT arm to Viam and can work with it through the platform. This foundational step allows you to remotely access and manage the arm, extend its functionality with some of Viam's SDKs, or extend its functionality with modules from the Viam Registry. Do let me know if you've built this!
Right now, you have a Yahboom DOFBOT arm that can take advantage of Viam's capabilities and can be controlled remotely. Why not: