Robot Teleop Using a Keyboard#
Hardware Prerequisites
You have a robot and a keyboard or an ssh/vnc connection to the robot.
This example uses the UP Xtreme i11 Robotic Kit.
Connect to your robot via ssh/vnc or direct access. If you choose direct access, insert a monitor and a keyboard into the robot’s compute system.
Check that EI for AMR environment is set:
echo $AMR_TUTORIALS # should output the path to EI for AMR tutorials /home/user/edge_insights_for_amr/Edge_Insights_for_Autonomous_Mobile_Robots_2023.1/AMR_containers/01_docker_sdk_env/docker_compose/05_tutorials
If nothing is output, refer to Get Started Guide for Robots Step 5 for information on how to configure the environment.
Start your robot’s node, and make sure that you have the correct remapping similar to this:
cd $CONTAINER_BASE_PATH docker compose -f 01_docker_sdk_env/docker_compose/01_amr/amr-sdk.all.yml run --rm aaeon-amr-interface bash ros2 run ros2_amr_interface amr_interface_node --ros-args -p try_reconnect:=true -p timeout_connection:=1000.0 -p publishTF:=true --remap /amr/cmd_vel:=/cmd_vel -p port_name:=/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
In another terminal, open full-sdk, and start teleop_twist_keyboard:
Note
The full-sdk docker image is only present in the Robot Complete Kit, not in the Robot Base Kit or Up Xtreme i11 Robotic Kit.
To check if you have it:
docker images |egrep "eiforamr-full-flavour-sdk" #if you have it downloaded, the result is: eiforamr-full-flavour-sdk
Note
If the image is not installed, continuing with these steps triggers a build that takes longer than an hour (sometimes, a lot longer depending on the system resources and internet connection).
cd $CONTAINER_BASE_PATH docker compose -f 01_docker_sdk_env/docker_compose/01_amr/amr-sdk.all.yml run --rm full-sdk bash ros2 run teleop_twist_keyboard teleop_twist_keyboard
Expected result: The robot responds to your keyboard commands in these ways:
i: Move forward
k: Stop
,: Move backward
j: Turn right
l: Turn left
q/z: Increase/decrease max speeds by 10%
w/x: Increase/decrease only linear speed by 10%
e/c: Increase/decrease only angular speed by 10%
L or J (only for omnidirectional robots): Strafe (move sideways)
anything else: Stop
Ctrl-c
: Quit