Bb8 keeps spinning - no friction, /cmd_vel doesnt fully work

Hi,
I’m trying to do the service quiz, bb8 moving in a square. My problem is that while there is friction for the linear movement, angular velocity 1. doesn’t go down over time and 2. doesn’t go to 0 when set so with /cmd_vel (angular.z stays at around 0.08). This makes the quiz, driving 3 squares after one another extremely difficult just using /cmd_vel

I tried for many hours to try to read the heading, but having problems with the quaternation. And a subscriber/command feedback loop doesn’t seem to be part of this exercise

Hi @simon.steinmann91,

For this, I’d suggest you try to use very low values for both linear and angular velocities (0.1 and 0.05, respectively, for example) so that the ball can move as slowly as possible. Then you can increase the velocities as needed.

Why this? At high velocities, any object (especially a ball) tends to have a very high momentum such that it continues to move even after you try to stop it! High linear velocity can even translate to angular motion after the ball is stopped.

In short, try to keep the velocities low if you want to control the ball more easily.

1 Like

I will try this, however there is a problem, where setting a velocity to 0, does not put the velocity to 0, even after waiting for some time. Also, is there a maximum rate (per second), that you should not go over, when issuing /cmd_vel commands? Let’s say I have a subscriber node, reading /odom and issuing /cmd_vel with each loop. Is there a problem when I dont add a delay or rate.sleep()?

I FINALLY DID IT :smiley:

okay, so using /odom is no good for getting the angle. you have to use /odom_good. /odom doesnt even return a Radian value, it’s Radian/Pi

2 Likes

Really strange. Perhaps your publication didn’t get to the robot? Please check if the topic below helps:

Robot not stopping or moving when you publish to cmd_vel? How to publish once (only one message) into a topic


Yes, you should not publish faster than your publisher’s queue_size can accommodate, otherwise, some messages will be dropped. You define the queue_size when you create a publisher like this:

publisher = rospy.Publisher('/cmd_vel', Twist, queue_size=5)

It’s a good idea to control your publishing rate with rate.sleep() or similar, so you don’t publish too fast.


Cheers

1 Like