ros-teleop / teleop_twist_keyboard

Generic Keyboard Teleop for ROS
256 stars 404 forks source link

There's no "k" key binding present in code #28

Open sskorol opened 2 years ago

sskorol commented 2 years ago

Hi,

In README and CLI instructions you mention "k" / "K" key that might be used for movements. But I don't see such binding in the code: https://github.com/ros-teleop/teleop_twist_keyboard/blob/master/teleop_twist_keyboard.py#L40-L59

As a result, it leads to confusion: you press the corresponding keys, but there's no feedback at all.

trainman419 commented 2 years ago

k is the stop key; on a qwerty keyboard it's in the center of the uio, jkl, m,. grouping. Similar to arrow keys, the surrounding keys indicate movement and the center key indicates "stop"

Since all non-movement keys send the stop message, there isn't an explicit key binding for it, which is why you don't see it in the code.

What were you expecting the k key to do?

sskorol commented 2 years ago

@trainman419 thanks for the clarification! But if we treat any key (which is not listed) as a "stop" operation, why do we even need to explicitly highlight "k" in the CLI instructions and README? It leads to confusion. I would rather assign a "move back" operation to "k", as it'd be much easier (and obvious) to control a robot the way how we do with common arrow keys in games.

trainman419 commented 2 years ago

The code for stop is right here: https://github.com/ros-teleop/teleop_twist_keyboard/blob/master/teleop_twist_keyboard.py#L210-L215

We assign "move back-left" to m, "move back" to ,, and "move back-right" to ., as an extension of the way that arrow keys are mapped on a numpad.

teleop_twist_keyboard supports robots that don't have a command timeout (they don't stop until you push the stop key), which makes it convenient to have a stop key in the center of the movement cluster, too.

Anyway; I can try to explain this to you all day, but in the end, teleop_twist_keyboard has been like this for almost a decade and I'm not even the original author; just the maintainer. My goal for this package is to continue maintaining it as a simple teleop option for ROS 1 robots that implement the /cmd_vel topic.

If you have a specific, actionable, and backwards-compatible change that I can make, please let me know.