My custom made DiffDrive plugin makes the vehicle flip, turn and fly away.

asked 2016-01-13 02:16:30 -0500

daltonfury42 gravatar image

updated 2016-01-13 02:18:03 -0500

I am trying to simulate a small differential wheeled robot that I am using for my swarm project. It is very small, and I made a basic model of the robot. The motors are controlled from an arduino by PWM, and there are encoders to give feedback on how much the two wheels have turned. My task is to do dead reckoning.

Since the existing differential drive plugin doesnot control the motors like how the arduino does, I made a code on my own to simulate the code run in the Arduino. But when I run the code, I get unexpected results as shown in the first 15 seconds of this youtube video I have uploaded.

Here is my code, if you ever want to look. The plugin gets the pos (x,y only) of the coordinate to which the robot should move, and it will be stored in xtarget and ytarget. For now, I have simply initialized both these variables to some value in the constructor for testing purpose.

edit retag flag offensive close merge delete


I had a problem like that using ros_control. I reduce the D parameter and my robot didn't fly away after that.

Brosseau.F gravatar imageBrosseau.F ( 2016-01-21 01:41:12 -0500 )edit