Joystick teleoperation cannot work on Jetson Xavier
Closed this issue · 1 comments
Hi
I want to use the joystick to remote control the create3 but cannot run.
-
Use environment
OS : ubuntu 20.04.06LTS
OS Type : 64bit
Graphics : NVIDIA Tegra Xavier
Building up by this link : https://iroboteducation.github.io/create3_docs/setup/jetson/
Start ROS 2 Galactic container
Version : dustynv/ros:galactic-ros-base-l4t-r35.1.0 -
Issues
Run Joystick command :
root@ros2-desktop:~# ros2 launch create3_teleop teleop_joystick_launch.py joy_dev:=/dev/input/js0
Command look like is ok, but joystick cannot contol.
[INFO] [launch]: All log files can be found below /root/.ros/log/2023-04-24-08-31-07-227911-ros2-desktop-17156
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [joy_node-1]: process started with pid [17158]
[INFO] [teleop_node-2]: process started with pid [17160]
[teleop_node-2] [INFO] [1682325067.966764605] [TeleopTwistJoy]: Teleop enable button 2.
[teleop_node-2] [INFO] [1682325067.966982657] [TeleopTwistJoy]: Turbo on button 5.
[teleop_node-2] [INFO] [1682325067.967053698] [TeleopTwistJoy]: Linear axis x on 1 at scale 0.700000.
[teleop_node-2] [INFO] [1682325067.967101602] [TeleopTwistJoy]: Turbo for linear axis x is scale 1.500000.
[teleop_node-2] [INFO] [1682325067.967142435] [TeleopTwistJoy]: Angular axis yaw on 0 at scale 0.400000.
[teleop_node-2] [INFO] [1682325067.967182276] [TeleopTwistJoy]: Turbo for angular axis yaw is scale 1.000000.
Then i find the ls /dev/input/.
Inside container cannot find js0 show error .
ls: cannot access '/dev/input/': No such file or directory
But outside container can see js0.
Jetson Xavier and Create3 are link same AP.
Am i missing something?
Hi @raysu1027, by default a docker container will not be able to see the devices from the host computer.
You should use the --device
flag when starting the container for that.
See more details here https://docs.docker.com/engine/reference/commandline/run/#device
Something like this should do it --device=/dev/input:/dev/input
Then, I recommend to also double check whether the Create 3 and the Jetson nano can communicate over ROS 2.
To do that, you can try to publish some velocity commands without using the joystick and see if the robot moves
ros2 topic pub -r 20 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.2, y: 0.0, z: 0.0}, angular: {x: 0.0, y: 0.0, z: 0.0}}"