Skip to content

C++ quick start

Installing GDK

Connect the development machine directly to the G02 robot with an Ethernet cable, and configure the development machine's static IP as 10.42.1.102. Make sure ping 10.42.1.101 works correctly.

Install the GDK dependencies on the development machine:

curl -sSL http://10.42.1.101:8849/install.sh | bash

Building with CMakeLists

Install cmake

sudo apt install cmake

Build

cd ~/.cache/agibot/app/gdk/examples/cpp
cmake -B build
make -C build

Running the robot motion control example

source ~/.cache/agibot/app/env.sh
./build/mc_example joint_name1 pos1 joint_name2 pos2 ...
joint_name is the robot joint name, and pos is the target joint position, in radians.

The joint_name list is as follows:

"idx01_body_joint1", #Waist, 5 DOF (from bottom to top)
"idx02_body_joint2",
"idx03_body_joint3",
"idx04_body_joint4",
"idx05_body_joint5",
"idx11_head_joint1", #Head, 3 DOF (r, p, y)
"idx13_head_joint3",
"idx12_head_joint2",
"idx21_arm_l_joint1", #Left arm, 7 DOF (from shoulder down)
"idx22_arm_l_joint2",
"idx23_arm_l_joint3",
"idx24_arm_l_joint4",
"idx25_arm_l_joint5",
"idx26_arm_l_joint6",
"idx27_arm_l_joint7",
"idx61_arm_r_joint1", #Right arm, 7 DOF (from shoulder down)
"idx62_arm_r_joint2",
"idx63_arm_r_joint3",
"idx64_arm_r_joint4",
"idx65_arm_r_joint5",
"idx66_arm_r_joint6",
"idx67_arm_r_joint7",