ros-teleop / teleop_tools

A set of generic teleoperation tools for any robot.
183 stars 140 forks source link

Do periodic publishing on tkinter loop instead of ROS timer. #72

Closed adeschamps closed 3 weeks ago

adeschamps commented 3 years ago

The ROS create_timer call never actually gets driven, because the main loop is blocked on self._root.mainloop() at the end of MouseTeleop.__init__. This commit uses a Tkinter after call instead and lets the Tkinter invoke the publish function.

Technically this will publish messages slightly less often than requested, because the function will be called every period + execution_time, but for a tool like this I think keeping the code simpler is more valuable.

adeschamps commented 3 years ago

I added commit 04195f3 which stops the publish loop when the mouse button is released. This takes care of a problem that I experienced where another process, such as a navigation stack, and the mouse_teleop node were fighting for control of the robot even when I wasn't trying to manually control the robot.

TakaHoribe commented 2 years ago

Just comment. I've faced the same issue and this PR completely fix my problem. Thank you.