ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

teleop_twist_joy doesn't publish

asked 2016-09-12 06:16:19 -0600

moooeeeep gravatar image

updated 2016-09-14 01:20:25 -0600

On Ubuntu I have installed the package ros-indigo-teleop-twist-joy in order to convert my joystick input (/joy) to velocity commands (/cmd_vel).

In order to test my setup I ran the provided launch file:

$ roslaunch `rospack find teleop_twist_joy`/launch/teleop.launch

which appears to run successful.

I can echo the output of /joy, which works as expected:

$ rostopic echo /joy
[...]
---
header: 
  seq: 1366
  stamp: 
    secs: 1473747626
    nsecs: 310893686
  frame_id: ''
axes: [0.0, -0.0, 0.0, 0.13615179061889648, 0.7007878422737122, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header: 
  seq: 1367
  stamp: 
    secs: 1473747626
    nsecs: 314848332
  frame_id: ''
axes: [0.0, -0.0, 0.0, 0.06840069591999054, 0.7346633672714233, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header: 
  seq: 1368
  stamp: 
    secs: 1473747626
    nsecs: 318864098
  frame_id: ''
axes: [0.0, -0.0, 0.0, 0.0006060103769414127, 0.8137062788009644, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header: 
  seq: 1369
  stamp: 
    secs: 1473747626
    nsecs: 322849686
  frame_id: ''
axes: [0.0, -0.0, 0.0, -0.0, 0.8475818634033203, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header: 
  seq: 1370
  stamp: 
    secs: 1473747626
    nsecs: 326847977
  frame_id: ''
axes: [0.0, -0.0, 0.0, -0.0, 0.9040411114692688, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header: 
  seq: 1371
  stamp: 
    secs: 1473747626
    nsecs: 330820131
  frame_id: ''
axes: [0.0, -0.0, 0.0, -0.0, 0.9830840229988098, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
header: 
  seq: 1372
  stamp: 
    secs: 1473747626
    nsecs: 334849495
  frame_id: ''
axes: [0.0, -0.0, 0.0, -0.0, 1.0, 0.0, 0.0, 0.0]
buttons: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
---
[...]

I can echo the output on /cmd_vel which produces the following ouput everytime I issue the command (and nothing but silence thereafter).

$ rostopic echo /cmd_vel
linear: 
  x: 0.0
  y: 0.0
  z: 0.0
angular: 
  x: 0.0
  y: 0.0
  z: 0.0
---

Looking at the package's default configuration, I would expect to see an effect when I turn the left stick of my gamepad (Logitech F710). Triggering any of the sticks and axes apparantly doesn't change anything.

roswtf and rqt_console are empty. Using rqt_graph I can see that everything is set up correctly (the joy_node is connected to the teleop_twist_node via /joy and the teleop_twist_node is connected to the running echo process via /cmd_vel).

What am I doing wrong?

edit retag flag offensive close merge delete

Comments

Can you post a sample for the msg on /joy topic?

DavidN gravatar image DavidN  ( 2016-09-12 20:54:07 -0600 )edit

@DavidN I have posted an extract of the /joy traffic.

moooeeeep gravatar image moooeeeep  ( 2016-09-13 01:26:55 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2016-09-13 02:17:20 -0600

gvdhoorn gravatar image

updated 2016-09-13 02:45:38 -0600

Are you pressing the enable button?

The teleop node doesn't send out anything, unless the 'operator' also keeps the enable button depressed. This is analogous to the deadman switches found on (industrial) teach pendants fi, and is meant to make it slightly harder for a robot to get out of control by (fi) someone randomly pressing buttons, or if someone lays something on top of the controller.

See the Parameters section on the teleop_twist_joy wiki page.

edit flag offensive delete link more

Comments

I haven't noticed an influence of any button presses so far either. But I think this may very well be the problem. Does the parameter value of enable_button define the index in the button array of the /joy message?

moooeeeep gravatar image moooeeeep  ( 2016-09-13 02:36:43 -0600 )edit

Yes. Press and hold down the enable button, while simultaneously moving the joystick. That should result in the appropriate Twist messages being published. Whenever you let go of the enable button publication will immediately stop.

gvdhoorn gravatar image gvdhoorn  ( 2016-09-13 02:42:50 -0600 )edit

I have now configured the enable_button and enable_turbo_button to match the indices of the buttons I want to use. Previously they were mapped to indices the joypad didn't address at all. Pressing them now, I get the expected output on /cmd_vel. Thanks for your input!

moooeeeep gravatar image moooeeeep  ( 2016-09-13 02:46:37 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-12 06:16:19 -0600

Seen: 4,538 times

Last updated: Sep 14 '16