ros-teleop / teleop_twist_keyboard

Generic Keyboard Teleop for ROS
256 stars 404 forks source link

Continuously publishing velocities #37

Closed kanishkanarch closed 1 year ago

kanishkanarch commented 1 year ago

PX4, some simulators, and some applications require constant stream of command velocities. This pull request keeps passing the stop (0,0,0,0) command if keyboard timeout occurs and the drone is stationary. Same robot behavior is observed with and without this PR. A stop key 'k' / 'K' is also added.

I did not delete the if condition in case discussion is required.

PS: The forked repository has code refactored for (AirSim's) PX4 multirotor with corrected coordinate directions and a little higher velocities, along with this PR of course (OFFBOARD mode requires commands at atleast 2 Hz).

trainman419 commented 1 year ago

If your application requires a constant stream of command velocity messages, consider using the repeat_rate option; this will cause the last command to be constantly published at the requested rate.

kanishkanarch commented 1 year ago

Ah, I didn't notice it. Thanks for mentioning! Closing this PR.