Robot cannot go straight

Hi, I am trying to move my robot go straight, but it did not.

I am using the UsdPhysics velocity API and using the transformation to convert the local velocity to global velocity.

The point is no matter how I try, the robot always goes left even I command robot to move straight.

I attached the video and the USD file.

hsr.usd (10.0 KB)

Thank you.

Allow me to add an extra problem, which, when I only input the angular velocity, the robot not only rotated, but iI moved a bit.

What I expected is it just does rotation and not any translation.

May I know what is the problem?

Hi,
Someone from our team will review your problem and respond shortly.

Thank you so much.
I’m looking forward to your reply soon。

Hello, I’ll start with the angular velocity - If the angular velocity were applied at the center of mass on an isolated system, it would indeed spin in place. Since you have a robot with multiple links and you apply a velocity at the origin of the base, it already breaks the Center of Mass assumption - therefore the torque will also generate a resulting linear velocity. Furthermore, since the object is in collision with the ground, it will resist such movement where it touches the ground, also resulting in linear velocities.

On the first video, the behavior seems to be correct. Bear in mind that there is a checkbox to define if velocity attributes are in global or local coordinates, but by default they are already in global. (check the Velocities in Local Space, as from image - in the properties panel)

Your code seems to be converting it to local coordinates and applying it in the X direction, you can confirm that by the red arrow in the robot gizmo.

Thank you so much for your detailed explanation.
Regarding the angular velocity:

  1. Is there any method to solve the problem, making it only spins in place?

Regarding the robot’s behaviour:

  1. I actually tried the “Velocities in Local Space”, and I found that whether it is checked or not, the robot behaviour was still the same. That is why I write the code to convert the velocity into the local coordinates. I want the velocity to be applied in local coordinates. Checking the “Velocities in Local Space” just simply didn’t work.

  2. The point is, why the robot turns left gradually? Even though velocity is applied in local coordinates in the X direction, it should be going straight (please observe the local coordinates at the beginning). Based on the video, initially, the global and local frames are perfectly aligned, when I enter the command, the robot SHOULD only move forward (in the x direction), leaving the frames still aligning, BUT the robot gradually moves forward and to the left, causing the frames to start misaligning. (Meaning the robot is not only moving move in x direction but somehow it rotates?). This is my problem.

Thank you.

I think there’s some confusion about what should be happening. I can see that the target velocity is actually correctly being applied in the local coordinates (as in its always going in the direction of the robot X axis).

What is happening is that because of the resulting motion the robot ends up turning slightly, and st every step it drifts more. That is common and will happen in any system (specially in real environments). It’s an “accumulation error”.

This drifting in case happens for the same reason as applying a torque will cause the robot to move: since the velocity is not applied exactly at the center of mass of the entire system (robot base plus all connecting bodies) it generates a torque, that will make it turn slightly.

I think the better question to ask here is: what is your end goal? Maybe you are trying the wrong things to achieve your goal.

Oh. Thank you so much for correcting me. And, I am sorry for my confusing question.

Because my real robot can move perfectly straight actually, I was expecting it does the same thing in the simulation.

So, may I know what I can do about this problem?
My ultimate goal is simple – the velocity command can be applied accurately.

Like, move forward in X direction for 5m.

In this scenario, may I know how I achieve this goal?

Hello, may I know if there is any feedback on this problem?

Thanks for the follow up!

According to your reply, what you want is controlling your robot wheelbase. With that In mind, I think directly applying forces (or the derivative version of it of directly applying velocities…) is not the ideal way of achieving this. Instead, what you should do is actually implement a drive for the wheelbase and control the joint velocities so you can move and rotate from there. I wasn’t able to open your usd, but I assume it has a directional drive wheelbase. We have this extension that may help you in that task

Thank you so much for the prompt reply, I actually tried this way:
So, before implementing the driver, the first thing I do was apply the same velocity to all the wheels. Supposedly, the robot SHOULD move forward, but its trajectory was exactly the same as shown in the video – gradually turning one side instead of going straight.

That is why I go for another way, thinking of instead of working on the driver, maybe I can directly move the whole body. But things are not going my way.

Thank you.

Got it. The next step would be to check for the robot inertia matrices and center of mass and check if it’s properly aligned. If it’s properly centered the robot won’t have issues going forward. Otherwise If it’s supposed to be off-center then the best you can do is have an IMU sensor and perform a closed loop controller to compensate for deviations in the desired angular velocity.

I see. Thank you for the suggestions. I also suspect that my robot’s center is off.
May I know how should I do to check if it is properly centered?

And, I have attached my USD file.

Thank you so much.

_hsr.usd (3.9 MB)