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

Oblique trajectory instead of a straight trajectory on a holonomic robot #89

Closed
MNLucas opened this issue Aug 7, 2018 · 8 comments · May be fixed by #112
Closed

Oblique trajectory instead of a straight trajectory on a holonomic robot #89

MNLucas opened this issue Aug 7, 2018 · 8 comments · May be fixed by #112

Comments

@MNLucas
Copy link

MNLucas commented Aug 7, 2018

Hi all,

Context and Issue

We are working with teb_local_planner on a holonomic robot.

We have an issue with the planning of forward trajectories because the planner always gets an oblique trajectory (i.e. the robot rotates 45º, then it moves obliquely, and at the end, it straightens up again according to the final orientation). This video shows the robot behavior and it can help you to understand better the situation.

This behavior makes sense since the vel/acc limitations are set for x and y axis (and theta also), so the optimizer is obtaining that the robot can move forward obliquely faster than moving straight ahead.

Question

How can we get trajectories no-oblique when the target is straight ahead?


Thanks in advance!

@croesmann
Copy link
Member

croesmann commented Aug 8, 2018

hey,
I am not working with holonomic robots right now, so it is very interesting to see this behavior.
And yeah, that's definitely the time-optimal solution as long as the goal is far away enough such that accelerating and decelerating is worth it.
Probably, the way to go is to change the optimization problem. However, the main objective is still time-optimality. So one can think of adding penalties for strafing or rotating (however, adding new penalty terms does usually not solve the problem completely, but only shifts resp. relaxes the problem, and it is harder to tune all the parameters.).
On the other hand, if we would add a further limitation for the superposition of the velocities, in particular
sqrt(vx^2 + vy^2), the optimizer should prefer the direct way since rotating by 45° and back requires extra time.
What do you think?

Edit:
I watched the video again, and I recognized that the robot is rotating while translating which makes sense. So adding the extra limitation leads to a non-empty nullspace if I am not mistaken. We might still need to add some regularization term, e.g. slightly penalizing strafing or rotation, depending on the application.

@MNLucas
Copy link
Author

MNLucas commented Aug 8, 2018

Great, thanks for the prompt response!

We thought to add an extra limitation for absolute velocity, as you said, this could be sqrt(vx^2 + vy^2).

We have never used g2o framework for optimization purpose. Could you help us with a suggestion about how to add this limitation?
We would like to implement and test this improvement for holonomic robots. So, a suggestion would be very helpful for us.

Thank you very much!

@croesmann
Copy link
Member

I added this to you in branch omni_abs_vel. You might have a look at the diff in order to investigate what I did to add the new penalty term for further changes.

I can only try this barely in my test simulation roslaunch teb_local_planner_tutorials robot_omnidir_in_stage.launch. So please test this in your setup. If further cost functions are required, feel free to add them and let me know.

@MNLucas
Copy link
Author

MNLucas commented Aug 9, 2018

Awesome, @croesmann!

Thank you so much!

We're going to work on this over the next week. We'll let you know the result of these tests asap.

@pingplug
Copy link

pingplug commented Nov 25, 2018

hypot(vx, vy) is good for onmi wheel, but it is not good enough for mecanum wheel(abs(vx) + abs(vy) + abs(omega))

@pingplug
Copy link

pingplug commented Dec 2, 2018

I have idea, it seems work (better than omni_abs_vel branch). But for some reason I can't tell now...
I'll make a pull request in three weeks.

@pingplug
Copy link

@MNLucas you can try PR #112 with onmi_type=2 (the type you are using in the video)
if you don't want oblique trajectory, you can try omni_type=0

@corot
Copy link
Collaborator

corot commented Mar 11, 2022

Fixed with #346

@corot corot closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants