Ask Your Question

Lag using XBOX controller

asked 2018-05-17 12:12:39 -0600

Kashyap.m94 gravatar image

Hey guys,

I am controlling my robot arm with XBOX controller. I have a python code written for the same and it works successfully and I am able to visualize the movements in RViz and Gazebo. But currently, I have the following problems:

  1. There is a lag between the time when I give the instructions through the controller and the time when it actually is visualized in RViz and gazebo. Is there any way that I can make sure that the moment I give the instruction through the controller, the action take place and is observed in RViz and gazebo?

  2. The sensitivity of the buttons in the controller is so high that if I press a button (that controls one joint) once, instead of being executed just once, it get executed 4-5 times. For instance, I have the increment step size as 0.1 for each time I press the button, instead of moving 0.1, the joint moves 0.4 or 0.5 or sometimes even more. How can I tackle this problem?

Thanks in advance for your help!

edit retag flag offensive close merge delete


If the 'controlling' you refer to is what you implemented in #q291009, the 'lag' is in MoveIt planning your next motion, and most likely not between the controller and the rest of your system.

gvdhoorn gravatar imagegvdhoorn ( 2018-05-17 12:33:31 -0600 )edit

Is there a way where in I can overcome this lag in the MoveIt, @gvdhoorn ?

Kashyap.m94 gravatar imageKashyap.m94 ( 2018-05-21 04:48:26 -0600 )edit

Planning takes time, there is no way around that.

However: I'm wondering why you are using a motion planner if you already know where you want to go (ie: simple increments in joint space). It seems to me that you should be using a trajectory generator, not a full blown motion planner.

gvdhoorn gravatar imagegvdhoorn ( 2018-05-21 05:00:58 -0600 )edit

It's because I am working on a student project and my task is to demonstrate that each joint is able to move by the commands given by the user.

Kashyap.m94 gravatar imageKashyap.m94 ( 2018-05-21 10:51:38 -0600 )edit

@gvdhoorn Hey, as you said that planning takes time and there is no way around it, sometimes, despite me giving the input through the controller, the arm doesn't move at all even if i wait for 3-4minutes. Then I close all the terminals and start it again. Is there anything I can do about it?

Kashyap.m94 gravatar imageKashyap.m94 ( 2018-05-22 04:00:43 -0600 )edit

And many a times, the terminal where I run the python code, just gets stuck after a while and it doesn't even respond to ctrl+c. I am not able to exactly know what the problem is. Could anyone of you guys help me? @gvdhoorn@PeteBlackerThe3rd

Kashyap.m94 gravatar imageKashyap.m94 ( 2018-05-22 04:37:49 -0600 )edit

I can't help you with your script I'm afraid.

the arm doesn't move at all even if i wait for 3-4minutes

well, it could be that planning actually failed. You'd have to check for success.

But again: I believe you should look at a trajectory generator, not a motion planner like MoveIt.

gvdhoorn gravatar imagegvdhoorn ( 2018-05-22 05:18:50 -0600 )edit

Something like jog_arm fi.

gvdhoorn gravatar imagegvdhoorn ( 2018-05-22 05:19:10 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-17 12:47:12 -0600

Regarding point 2. This is nothing to do with the sensitivity of the controller, and everyone to do with how quickly the messages are being published by the controller.

If you could update your code so that it detects the transition from a button being off to on instead of just checking if the button is on then you should be able to get exact 0.1 radian movements.

edit flag offensive delete link more


I believe the accepted terminology is "edge triggered" vs "level triggered".

gvdhoorn gravatar imagegvdhoorn ( 2018-05-17 12:51:53 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-05-17 12:12:39 -0600

Seen: 195 times

Last updated: May 17 '18