Robot moving very slow n choppy

1,052 views
Skip to first unread message

Arif Rahman

unread,
Nov 10, 2014, 12:23:47 AM11/10/14
to ros-by-...@googlegroups.com
Hi Patrick and the RBX community, 

I've built a mobile base using the ros-arduino-bridge, and then followed along the guides in RBX to get the navigation stack working on the robot. 

1.
I've managed to get the motors to move when I run keyboard teleop. However, there is a significant lag (1-2 sec) between the time I press (and hold) a key until the motors actually move. This happens even when the robot is suspended i.e. no load. And I have to press AND HOLD the key, a short keypress would not move the motors at all. 

Plus, the P gain has to be really big, like 50 or more. Then only the motors move. But the lag is still there.

Is this supposed to be right? 


2.
I've then tried opening RVIZ, and send goal commands interactively using the point-and-click feature. It registered on the robot, both local n global path lines are displayed on screen, but the robot moves very slowly, if at all. At times when it does move, the motors moves like having a 'hiccup', inching towards the goal. And so far it has never reached the goal at all. It managed to move a bit, maybe orient itself towards the goal, move a bit more, but then just stops. Not moving at all.


Any ideas on whats happening here? Any suggestions would be appreciated. 

Thanks,
Arif


Patrick Goebel

unread,
Nov 11, 2014, 9:26:13 AM11/11/14
to ros-by-...@googlegroups.com
Hi Arif,

How is your computer connected to the Arduino? Is it a wireless
connection or direct with a USB cable? If you haven't done so already,
try talking to the Arduino directly by running the ros-arduino-bridge
sketch and using the Arduino IDE to send single letter commands like "m
100 100" to move the two motors. Remember to do this with the robot on
blocks. Also, note that the numbers here are in encoder ticks per
second so if your motor/encoder setup produces 1000 ticks per
revolution, then "m 100 100" would try to turn the wheel 1/10 of a
revolution per second. Finally, keep in mind that the default
ros-arudino-bridge sketch has a 2 second auto stop so that if it does
not receive a motor command within 2 seconds, it will stop the motors.

--patrick

Arif Rahman

unread,
Nov 17, 2014, 2:40:32 AM11/17/14
to ros-by-...@googlegroups.com
Sorry for the late response :(

I've finally found what was wrong :D

The ros_arduino_bridge was working perfectly, so when I ran "m 100 100", the motors moved fine. 

The problem was that I launched move_base, and then told the robot to move using BOTH keyboard_teleop AND through RVIZ. They both publish cmd_vel topics, which then conflicted with each other, and caused the choppy motion. So if I close keyboard_teleop, I can then move the robot perfectly using RVIZ. It can now get to the goals I set while avoiding any obstacles.


***

Back to the PID settings in my_arduino_params.yaml. Am I right to assume that the PIDs are to balance the two wheels? If my robot *wobbles* (ie moves like a snake) when driving forward, is this the PID settings that I need to tune?



Regards,
Arif

Patrick Goebel

unread,
Nov 17, 2014, 10:02:31 AM11/17/14
to ros-by-...@googlegroups.com
Hi Arif,

Good to hear you discovered the problem.  Yes, both the joytstick and keyboard teleop nodes tend to publish a cmd_vel message of "0" by default so if they are both running, the one that isn't being operated is inserting "Stop" messages in between the commands sent by the other one.

PID parameters determine how to control the error between the desired motion of the wheels and the actual motion as measured by the encoders.   So yes, an over correction can cause a wobble or "fish tailing" as it is sometimes called.  However, you can also get this problem if your teleop or move_base parmaters need to be adjusted.  To check your PID parameters, launch your ros_arduino_bridge node then publish a "straight ahead" cmd_vel message as shown below.  Do this first with the robot's wheels off the ground in case your speed mapping is incorrect and the robot flies across the room:

$ rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{ linear: {x: 0.05} }'

Type Ctrl-C to stop the robot.

If your robot goes straight using this command, then your PID parameters are probably OK.  You can then check the ratio of angular and linear parameters in your teleop launch file.  For example, in the joystick_teleop.launch file located in the rbx1_nav directory, the angular and linear parameters look like this:

    <param name="scale_angular" value="1.5"/>
    <param name="scale_linear" value="0.3"/>

Wobbling may occur if the value of the scale_angular parameter is too high compared to the scale linear value so try reducing it to, say, 1.0.

If the robot does *not* go straight when publishing the above cmd_vel message, then you might have to tweak your PID parameters.  This would get us into another discussion so I'll wait to hear back your results first.

--patrick
--
You received this message because you are subscribed to the Google Groups "ros-by-example" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-by-exampl...@googlegroups.com.
Visit this group at http://groups.google.com/group/ros-by-example.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages