neobotix / neo_teleop2

ROS-2 Teleoperation node for Neobotix robots
1 stars 1 forks source link

fix sudden robot movements at first initialization of ROS, during each time when the robot is switched on #17

Open padhupradheep opened 1 year ago

padhupradheep commented 1 year ago

After long non-usage of the Logitech joystick, the analog sticks on them, moves from their 0 position, due to which there is a sudden motion of robot. To avoid this, a possible deadband region needs to be added..

padhupradheep commented 1 year ago

Deadzone is already part of the configs: https://github.com/neobotix/neo_mpo_700-2/blob/f9985665a6e7253f3b7b555906953044694edb22/configs/teleop/teleop.launch.py#L27

padhupradheep commented 1 year ago

We investigated further and found that, the initial value for all the axes in the D-Mode is set to -32767, which then in turn is scaled to -1.0 by the joy node. For X-Mode, the values of all the axes are set to 0.

Fix for now / work around: For the first instantiation of ROS, during each time when the robot is switched on, it is very essential that, the axes of the joystick are moved in all the possible direction, before starting the operation (i.e. more specifically before touching the deadman button). This would indeed bring the axes values to 0 or close to 0 (not a problem, since we have a deadzone attached to it)

Areas to investigate: We should probably further look into the drivers of the joystick for Ubuntu 22.04 (problem started only from here, as far as I can remember) and the joy node from ROS Drivers, to probably find a way to induce or inject 0 as the initial value.

Note that, on pressing the deadman button, the axes values are triggered to 0. But the joy node does not read the axes values when they are triggered, since they do event based handling. Therefore the axes values are not reset, which eventually raises the need for manual reset of these values. Manual reset is as said, it is just moving the axes in all possible directions.

CC: @neomob @neopar

neojaw commented 1 year ago

I'm on Ubuntu 20.04 and I also get the -32767 as initial values, i.e. with a freshly connected joystick on D mode. So at least on driver side this behaviour has been around for a while.