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

Add possibility to weight viapoint orientations #109

Open
wants to merge 5 commits into
base: kinetic-devel
Choose a base branch
from

Conversation

zerodamage
Copy link

For issue/enhancement of via-point following

	modified:   cfg/TebLocalPlannerReconfigure.cfg
	modified:   include/teb_local_planner/g2o_types/edge_via_point.h
	modified:   include/teb_local_planner/optimal_planner.h
	modified:   include/teb_local_planner/teb_config.h
	modified:   src/homotopy_class_planner.cpp
	modified:   src/optimal_planner.cpp
	modified:   src/teb_config.cpp
	modified:   src/test_optim_node.cpp
	modified:   src/visualization.cpp
	modified:   src/optimal_planner.cpp
	modified:   src/teb_local_planner_ros.cpp
	modified:   CMakeLists.txt
@zerodamage zerodamage closed this Nov 30, 2018
@zerodamage zerodamage deleted the origin/master branch November 30, 2018 14:58
@zerodamage zerodamage restored the origin/master branch November 30, 2018 14:58
@zerodamage zerodamage deleted the origin/master branch November 30, 2018 14:59
@zerodamage zerodamage restored the origin/master branch November 30, 2018 14:59
	new file:   src/test_optim_node.cpp
@zerodamage zerodamage reopened this Dec 1, 2018
	modified:   src/test_optim_node.cpp
@croesmann
Copy link
Member

Hey Christian ;-)
Thanks for creating this pull request. Can you update me on the status? Should we merge this in?

Copy link
Author

@zerodamage zerodamage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments for on/off switch

@@ -295,7 +295,7 @@ void HomotopyClassPlanner::renewAndAnalyzeOldTebs(bool delete_detours)

void HomotopyClassPlanner::updateReferenceTrajectoryViaPoints(bool all_trajectories)
{
if ( (!all_trajectories && !initial_plan_) || !via_points_ || via_points_->empty() || cfg_->optim.weight_viapoint <= 0)
if ( (!all_trajectories && !initial_plan_) || !via_points_ || via_points_->empty() || (cfg_->optim.weight_viapoint <= 0 && cfg_->optim.weight_viapoint_orientation))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably needs some work...


int index = teb_.findClosestTrajectoryPose(*vp_it, NULL, start_pose_idx);
int index = teb_.findClosestTrajectoryPose(temp.position(), NULL, start_pose_idx);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know if this could be done in a more optimal code style

@zerodamage
Copy link
Author

Hi Christoph :)

There are some minor things as noted above, but otherwise, it should be good to go.

In the documentation, it might be worth noting that very high weights combined with sharp corners can cause oscillation or stuck behaviors.

Best, @zerodamage

@andriimaistruk
Copy link

@croesmann Hi, what the status of this pr?
@zerodamage could you provide a example of your changes actually making TEB considering poses orientation instead of just their x,y?

@zerodamage
Copy link
Author

zerodamage commented Nov 4, 2022

The changes are most easily observed in:
include/teb_local_planner/g2o_types/edge_via_point.h

Adding the line:
_error[1] = g2o::normalize_theta(bandpt->theta() - _measurement->theta());

Wherein the error in orientation is added to the graph for viapoints.

That along with all the other changes to make the orientation available throughout the code as seen in the change from Vector2 to PoseSE.

For now the orientation is calculated using atan2 between adjacent points.

Buyer beware: if the orientation weight is set very high on a non-holonomic vehicle, the solver can get stuck, due to the conflicting constraints on position and orientation.

@andriimaistruk
Copy link

Thanks! I see, one more question here about error value range, as in this optimization problem we try to minimize the error - push it to zero, correct? I tried to run your changes locally, I observed g2o::normalize_theta(bandpt->theta() - _measurement->theta()); outputting negative values as well, which shouldn't happen, or am I missing something here?

@zerodamage
Copy link
Author

Thanks! I see, one more question here about error value range, as in this optimization problem we try to minimize the error - push it to zero, correct? I tried to run your changes locally, I observed g2o::normalize_theta(bandpt->theta() - _measurement->theta()); outputting negative values as well, which shouldn't happen, or am I missing something here?

Right! I've apparently missed the norm/absolute of the error in that line

@andriimaistruk
Copy link

Do you plan for this pr to be merged into teb_local_planner ros2-master?
I had to make some minor changes to run it with the galactic version (I might share them if needed)

@andriimaistruk
Copy link

@zerodamage

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

Successfully merging this pull request may close these issues.

3 participants