ros-teleop / teleop_twist_joy

Simple joystick teleop for twist robots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic buttons?

jeskesen opened this issue · comments

Great node! Thanks for making public.

Typically, I also need buttons to interact w/ my robots, though what they do would be different for each of them. Now, I could inherit from your class and create static buttons for each robot's teleop. What about making the buttons generic, so that a button's events can be output as a topic, set as params. Then, for each robot, joystick teleop would just be a matter of setting up a launch file. Buttons would of course be optional.

I'm happy to do the development on this, if you think it'd be a good feature.

Hard to picture how this would work in the context of the C++ implementation. If you're wanting this type of more generic functionality, the Python-implemented joy_teleop may be a better fit:

https://github.com/ros-teleop/teleop_tools/tree/hydro-devel/joy_teleop

I had been thinking of a std::map<int, string> which would publish a bool when the button's state changed. For config, it could simply loop through some number of string params named button_N_topic where N is an integer from 0-MAX_BUTTONS... whatever that may be.

That said, I hadn't noticed the joy_teleop python node... and maybe that'll work just fine for what I'm doing.

The existing joy_teleop is very, very flexible, much moreso than would ever be possible from C++. The C++ node exists as a simple drop-in, or for situations where you want to compile it in for whatever reason.