# Individual wheel angular velocity

**URL:** <https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781>\
**Category:** General Questions\
**Created:** [April 1, 2021, 9:32pm UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781 "2021-04-01T21:32:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajinkya24](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@ajinkya24](https://forum.ubiquityrobotics.com/u/ajinkya24)\
**Post date:** [April 1, 2021, 9:32pm UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/1 "2021-04-01T21:32:40Z")

</div>

Hello guys,

I have a Magni Silver robot with the MCB version 5.2. I was wondering if there is any way to get individual wheel angular velocities for the motor-operated wheels? Also, if anyone knows what the rostopics ‘left error’ and ‘right error’ from the ‘motor\_node’ mean that would be helpful?

Thanks  
Ajinkya

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [April 2, 2021, 3:40am UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/2 "2021-04-02T03:40:47Z")

</div>

If you have current firmware of v40 and are running current ubiquity\_motor node then the angular velocities are in topic joint\_states for the array of velocity  
Mark

---

<div class="post-metadata">

**Author:** ![ajinkya24](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@ajinkya24](https://forum.ubiquityrobotics.com/u/ajinkya24)\
**Post date:** [April 2, 2021, 3:56pm UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/3 "2021-04-02T15:56:07Z")

</div>

Hey Mark, I have the current firmware v40. I see the joint\_states topic but it shows velocity as zero even though the robot is moving. Please advise.

Thanks  
Ajinkya

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [April 2, 2021, 6:42pm UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/4 "2021-04-02T18:42:59Z")

</div>

You are describing a defect which we addressed but I now must verify that it made it’s way into our main ubiquity\_motor repository. Can you tell me if if you have a folder of /home/ubuntu/catkin\_ws/src/ubiquity\_motor?

If you do not have that folder or if it is not current that would explain this right away. This fix was within the last couple months so it does not exist on our images yet by default.

For getting current code you need your Pi to be able to access the internet to pull from our github. If you do not know how to setup to be on the internet see this:

> **[Connecting the Robot to Your Network](https://learn.ubiquityrobotics.com/connect_network)**
>
> Tutorials for Magni

Below are short instructions on use of our repository code which is a form of Beta software distribution for those who want mostly newest features.  
If you have questions from below see this page in the middle: [https://learn.ubiquityrobotics.com/updating](https://learn.ubiquityrobotics.com/updating)

If the folder is not there that would explain what you describe.

1. If the folder is there then cd into it and type ‘git pull’.
2. If the folder is NOT there then cd to ~/catkin\_ws/src and type this:  
git clone [https://github.com/UbiquityRobotics/ubiquity\_motor](https://github.com/UbiquityRobotics/ubiquity_motor)

After whichever of the above you had to do then we must re-make the code:  
cd ~/catkin\_ws  
sudo systemctl stop magni-base  
catkin\_make

Once the make completes reboot the robot: sudo shutdown -r now

I have looked in our repository and the fix seems to be there so above I fell will work  
Thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [April 4, 2021, 1:05am UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/5 "2021-04-04T01:05:48Z")

</div>

> [@ajinkya24](#):
>
> rostopics ‘left error’ and ‘right error’ from the ‘motor\_node’ mean

Second question for the two error terms is that these indicate the current PID loop error for each wheel. When steady these sit near 0. When you do an abrupt step in velocity (perhaps using teleop\_twist\_keyboard) the error will jump up and as the PID loop catches up with proper speed error settles back to zero. These topics are used to graph in realtime this error and tune the PID cooefficients.

We implement our PID loop based on expected position, not expected velocity. So this error term is error in expected position. Regulating on position allows more precise endpoint determination is why we do it this way.

---

<div class="post-metadata">

**Author:** ![ajinkya24](https://forum.ubiquityrobotics.com/letter_avatar_proxy/v4/letter/a/c67d28/32.png) [@ajinkya24](https://forum.ubiquityrobotics.com/u/ajinkya24)\
**Post date:** [April 5, 2021, 3:57pm UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/6 "2021-04-05T15:57:32Z")

</div>

Hey Mark thanks for the tips. Sorry for replying so late. I did not have access to the robot over the weekend. Adding the ubiquity\_motor in catkin workspace helped in getting the wheel velocities. I just want to knw whether they are angular velocities or linear velocities?

---

<div class="post-metadata">

**Author:** ![mjstn2011](https://forum.ubiquityrobotics.com/user_avatar/forum.ubiquityrobotics.com/mjstn2011/32/30_2.png) [@mjstn2011](https://forum.ubiquityrobotics.com/u/mjstn2011)\
**Post date:** [April 5, 2021, 8:10pm UTC](https://forum.ubiquityrobotics.com/t/individual-wheel-angular-velocity/781/7 "2021-04-05T20:10:53Z")

</div>

I believe they are angular velocities for the joint topic.  
The units for ROS for angular are radians per second.  
Our standard wheels have a circumference of 0.637 Meters  
Here is a verification you can put the robot on blocks so wheels don’t hit ground.  
rostopic pub -r 10 /cmd\_vel geometry\_msgs/Twist ‘{ linear: {x: 0.32} }’  
Doing this the velocities will read about 3.14 sort of number or Pi rads/sec  
And the wheels will rotate one turn every 2 seconds.  
It just so happens the circumference comes out to a ‘nice’ value in being about 0.64 meters it is ‘close’ to 2 Pi / 10 but that is basically per chance.
