ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Quick summary:
keys
topic, the keys_cb
callback is triggered, and the argument msg
contains that latest messagekeys
message, the keys_cb
updates the value of the global variable g_last_twist
.g_last_twist
keys_cb
is also passed a reference to the twist_pub
publisher via the callback_args
keyword argument in the constructor for a rospy.Subscriber
. The callback also publishes the latest value of g_last_twist
using its reference to the twist_pub
-- presumably so you don't need to wait until the next iteration of the main while
loop to get the value published.