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

Do not add joint waypoint to fixed indices if not constrained #427

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rjoomen
Copy link
Contributor

@rjoomen rjoomen commented Dec 14, 2023

Cartesian waypoints are never added as fixed, but joint and state waypoints almost always.

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.63%. Comparing base (8cd38f5) to head (cca499e).

Current head cca499e differs from pull request most recent head 5cf4ff3

Please upload reports for the commit 5cf4ff3 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #427      +/-   ##
==========================================
- Coverage   85.73%   85.63%   -0.10%     
==========================================
  Files         233      221      -12     
  Lines       15347    14677     -670     
==========================================
- Hits        13157    12569     -588     
+ Misses       2190     2108      -82     

see 203 files with indirect coverage changes

@Levi-Armstrong
Copy link
Contributor

Levi-Armstrong commented Dec 14, 2023

I would recommend seeing if we can leverage the trajopt profile to indicate of a waypoint should be treated as fixed. In case when you have extra degrees of freedom these changes will not be ideal.

@rjoomen
Copy link
Contributor Author

rjoomen commented Dec 14, 2023

Sure, I was just trying to fix the todo. How exactly do you suggest I do that? And does that only apply to the Cartesian waypoints or also to the other types?

Also, the joint and state waypoints still have todos saying they should not be fixed if they are of term type cost, but I wasn't sure how to obtain the correct profile information.

@Levi-Armstrong
Copy link
Contributor

Levi-Armstrong commented Dec 14, 2023

I would probably update the TrajOpt Plan Profile to return a bool to indicate if it should be treated as fixed. If we think there may be other things that we want to return we could create a struct which gets returned allowing us to expand it in the future if needed.

@rjoomen
Copy link
Contributor Author

rjoomen commented Dec 15, 2023

How about this?

(I am unsure about how to handle the state waypoint type, btw, should that be the same way as joint?)

@marrts
Copy link
Contributor

marrts commented Dec 18, 2023

Does this change mean that if we have a fully constrained Cartesian waypoint and a seed joint state for that waypoint the output will always be equivalent to the seed? It looks like trajopt just skips the fixed steps and doesn't add them to the problem at all. This would be problematic for applications where you have redundant axes that you want TrajOpt to smooth across waypoints, but you still have strict Cartesian requirements

@rjoomen
Copy link
Contributor Author

rjoomen commented Dec 20, 2023

Does this change mean that if we have a fully constrained Cartesian waypoint and a seed joint state for that waypoint the output will always be equivalent to the seed? It looks like trajopt just skips the fixed steps and doesn't add them to the problem at all. This would be problematic for applications where you have redundant axes that you want TrajOpt to smooth across waypoints, but you still have strict Cartesian requirements

That is a good point. @Levi-Armstrong should cartesian waypoints maybe never be fixed (which effectively is the current situation)? Should I remove that part and only leave the logic pertaining the joint waypoints?

@rjoomen
Copy link
Contributor Author

rjoomen commented Jan 8, 2024

I went ahead and removed the fixed cartesian waypoint logic. Now this PR only fixes this and this todo.

Now how should state waypoints be handled?

@rjoomen rjoomen changed the title Add cartesian waypoints to fixed indices Do not add joint waypoint to fixed indices if not constrained Jan 8, 2024
@Levi-Armstrong
Copy link
Contributor

I went ahead and removed the fixed cartesian waypoint logic. Now this PR only fixes this and this todo.

Now how should state waypoints be handled?

State waypoints should be treated as fixed joint state.

@rjoomen
Copy link
Contributor Author

rjoomen commented Jan 9, 2024

State waypoints should be treated as fixed joint state.

But the todo suggests to not make them fixed if they are cost instead of constraint.

@marrts
Copy link
Contributor

marrts commented Jan 12, 2024

State waypoints should be treated as fixed joint state.

So are state waypoints assumed to be always fixed in regards to their position? They aren't fixed in velocity, acceleration, or time stamp because time parameterization tasks expect state waypoints as inputs. So to me it seems arbitrary that you'd expect TrajOpt to treat state waypoints position values as fixed. I know we also have joint waypoints that could or couldn't be fixed, but I feel like there's probably a scenario that a previous planner produces a state waypoint that you want TrajOpt to treat as only a cost.

I also think the fact that for a given profile we have to set all types of waypoints to either a cost or constraint makes this more complicated. That's part of the motivation behind my other PR, #403, where I changed the TrajOptDefaultPlanProfile to have different configs for each waypoint type. I could add another one for state waypoints too, giving control over setting it to a cost (not fixed) vs constraint (fixed).



CartesianWaypointConfig cartesian_cost_config;
CartesianWaypointConfig cartesian_constraint_config;
JointWaypointConfig joint_cost_config;
JointWaypointConfig joint_constraint_config;

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