Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicle velocity oscillates badly during teleop #4

Open
pjreed opened this issue Mar 19, 2020 · 1 comment
Open

Vehicle velocity oscillates badly during teleop #4

pjreed opened this issue Mar 19, 2020 · 1 comment

Comments

@pjreed
Copy link

pjreed commented Mar 19, 2020

I've got a 4wd rover, and I'm trying to set it up so that I can teleop it with a joystick using ROS 2. I'm using an Intel NUC that has Ubuntu 18.04 and ROS Dashing installed.

First, when I start the openrover_demo hardware.launch.py and teleop.launch.py, I can send use the keyboard to send it commands, but the velocity oscillates badly, so it seems like the vehicle is constantly jerking forward. The values in the /cmd_vel topic look reasonable, but the /motor_efforts bounce around quiet a bit, and I suspect it may be due to a badly PID controller somewhere in the driver.

Also, when I lower the velocity back near zero, it tends to suddenly rocket away at top speed. The nickp/prevent_near_zero_runaway branch in this repository seems to fix that, so it would be nice to have that merged in.

Next, I've also tried using the standard teleop_twist_joy_node to use a joystick to publish Twist messages to /cmd_vel. I've observed similar behaviors, except that the angular velocity is very slow even when the joystick is turned all the way, so that's probably just an issue of scaling the magnitude somewhere; another issue, though, is that the teleop_twist_joy_node stops publishing Twist messages if the joystick axes are within their dead zones, and a side effect is that it seems like the openrover driver stops changing the motor efforts when it stops receiving Twists. A behavior I very frequently observe is that if the motor efforts are almost reduced to neutral, but not quite, the rover will stop moving but its internal fans will keep running, and so I have to very lightly tap the joystick until it drops all the way to neutral and the fans turn off.

@rotu
Copy link
Collaborator

rotu commented Mar 25, 2020

Thanks, @pjreed, for the in-depth writeup!

  1. Yes, the motor efforts are based on a PI controller which was tuned for the rover in 2 wheel drive mode. This differs significantly from 4 wheel drive mode, as you can see.
  2. Thanks and you're totally right! I've merged @padiln's fix!
  3. The thing to do here seems to be to tune the PI controller. Ihttps://github.com/RoverRobotics/openrover-ros2/blob/5f127a26e82c5dcc20f6346abc613d2568d68b0d/openrover_demo/config/hardware.yaml#L5-L13 I would drop motor_controller_gain_i to 0 and raise motor_control_gain_p until it starts to behave sanely, and maybe decrease the windup.
  4. Thanks for the report about joystick timeout. Yes, I should and will add a control timeout!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants