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

Python bindings for methods of GcsTrajectoryOptimization::Subgraph for adding generic costs and constraints. #22156

Conversation

cohnt
Copy link
Contributor

@cohnt cohnt commented Nov 12, 2024

Towards #21981. Adds python bindings to the methods introduced in #22091.


This change is Reviewable

@cohnt cohnt added the release notes: feature This pull request contains a new feature label Nov 12, 2024
@xuchenhan-tri
Copy link
Contributor

Hi @cohnt, is this PR ready to be reviewed yet? (asking per https://drake.mit.edu/platform_reviewer_checklist.html)

@cohnt
Copy link
Contributor Author

cohnt commented Nov 13, 2024

Yes, I need a feature reviewer. I asked in slack, but didn't get any responses yet.

@xuchenhan-tri
Copy link
Contributor

I see @sadraddini lurking in this PR. Would you like to review it? If not, I'll kick this PR to Russ to review/delegate per platform reviewer checklist.

@cohnt cohnt added the status: single reviewer ok https://drake.mit.edu/reviewable.html label Nov 14, 2024
@cohnt
Copy link
Contributor Author

cohnt commented Nov 14, 2024

Per Jeremey's comment in the Drake Developers Slack, since this is just adding python bindings, we can send this directly to platform review.

So @xuchenhan-tri for review, please!

Copy link
Contributor

@xuchenhan-tri xuchenhan-tri left a comment

Choose a reason for hiding this comment

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

:lgtm: with a couple of comments

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: 2 unresolved discussions


bindings/pydrake/planning/planning_py_trajectory_optimization.cc line 435 at r1 (raw file):

                -> const MatrixX<symbolic::Variable> {
              return self.vertex_control_points();
            },

What's the point of the const qualifier if we are returning a copy?

Ditto for the same pattern below.

Suggestion:

            [](const GcsTrajectoryOptimization::Subgraph& self)
                -> MatrixX<symbolic::Variable> {
              return self.vertex_control_points();
            },

bindings/pydrake/planning/test/trajectory_optimization_test.py line 365 at r1 (raw file):

        regions.AddEdgeCost(edge_cost)
        regions.AddEdgeConstraint(edge_constraint)

We should add some tests that exercises the keyword arguments (with and without the default arg).

@cohnt cohnt force-pushed the gcstrajopt-generic-cost-constraint-bindings branch from 466a636 to 544bd62 Compare November 14, 2024 20:40
Copy link
Contributor Author

@cohnt cohnt left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 unresolved discussions


bindings/pydrake/planning/planning_py_trajectory_optimization.cc line 435 at r1 (raw file):

Previously, xuchenhan-tri wrote…

What's the point of the const qualifier if we are returning a copy?

Ditto for the same pattern below.

Done.


bindings/pydrake/planning/test/trajectory_optimization_test.py line 365 at r1 (raw file):

Previously, xuchenhan-tri wrote…

We should add some tests that exercises the keyword arguments (with and without the default arg).

Like so?

Copy link
Contributor

@xuchenhan-tri xuchenhan-tri left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee xuchenhan-tri(platform)


bindings/pydrake/planning/test/trajectory_optimization_test.py line 365 at r1 (raw file):

Previously, cohnt (Thomas Cohn) wrote…

Like so?

Yes, thank you!

@cohnt cohnt merged commit f50f18c into RobotLocomotion:master Nov 14, 2024
8 of 9 checks passed
@cohnt cohnt deleted the gcstrajopt-generic-cost-constraint-bindings branch November 14, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: feature This pull request contains a new feature status: single reviewer ok https://drake.mit.edu/reviewable.html
Projects
Development

Successfully merging this pull request may close these issues.

2 participants