ros-teleop / twist_mux

Twist multiplexer
Apache License 2.0
56 stars 83 forks source link

Updating Diagnostics? #5

Closed fmessmer closed 8 years ago

fmessmer commented 8 years ago

For some reason it seems twist_mux does not update all the status of its diagnostic message: Although one of the topics is unmasked, the values of the keys current priority, loop time and data age are not updated... Anybody seen this, too?


---
header: 
  seq: 789
  stamp: 
    secs: 873
    nsecs: 0
  frame_id: ''
status: 
  - 
    level: 0
    name: base/twist_mux: Twist mux status
    message: ok
    hardware_id: none
    values: 
      - 
        key: velocity navigation
        value:  masked (listening to twist_mux/command_navigation @ 0.250000s with priority #20)
      - 
        key: velocity collision_velocity_filter
        value:  masked (listening to twist_mux/command_safe @ 0.250000s with priority #10)
      - 
        key: velocity teleop_joystick
        value:  masked (listening to twist_mux/command_teleop_joy @ 0.250000s with priority #100)
      - 
        key: velocity teleop_keyboard
        value:  unmasked (listening to twist_mux/command_teleop_keyboard @ 0.500000s with priority #80)
      - 
        key: velocity teleop_android
        value:  masked (listening to twist_mux/command_teleop_android @ 0.500000s with priority #90)
      - 
        key: velocity script_server
        value:  masked (listening to twist_mux/command_script_server @ 0.500000s with priority #70)
      - 
        key: velocity syncmm
        value:  masked (listening to twist_mux/command_syncmm @ 0.500000s with priority #70)
      - 
        key: lock pause_navigation
        value:  free (listening to twist_mux/locks/pause_navigation @ 0.000000s with priority #21)
      - 
        key: lock pause_teleop
        value:  free (listening to twist_mux/locks/pause_teleop @ 0.000000s with priority #101)
      - 
        key: lock pause_all
        value:  free (listening to twist_mux/locks/pause_all @ 0.000000s with priority #255)
      - 
        key: current priority
        value: 0
      - 
        key: loop time in [sec]
        value: 0
      - 
        key: data age in [sec]
        value: 0
efernandez commented 8 years ago

Could you provide an example that I use to reproduce it?

fmessmer commented 8 years ago

Hmm, minimal example would be to run: roslaunch cob_bringup twist_mux.launch robot:=cob4-2 (see here: https://github.com/ipa320/cob_robots/blob/indigo_dev/cob_bringup/tools/twist_mux.launch)

Then subscribe to /diagnostics: rostopic echo /diagnostics

and publish to e.g. /twist_mux/command_teleop_joy:

rostopic pub /twist_mux/command_teleop_joy geometry_msgs/Twist "linear:
  x: 0.0
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.0" -r 10

You will see the following keys unchanged:

      - 
        key: current priority
        value: 0
      - 
        key: loop time in [sec]
        value: 0
      - 
        key: data age in [sec]
        value: 0
efernandez commented 8 years ago

Thanks @ipa-fxm

It looks like at least the loop time is deprecated.

Before I make twist_mux public, the implementation wasn't asynchronous, but using a loop instead (publishing at a constant frequency, decoupled from the inputs). That was a bad idea because it changed the input signal, discretizing the values in time. I changed it, but it seems that I forgot to update/deprecate some of the diagnostic fields.

efernandez commented 8 years ago

Solved with #10

If you feel something is now missed or needed, please create a new issue @ipa-fxm .