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

Effort limits for KinematicTrajectoryOptimization #22500

Closed
RussTedrake opened this issue Jan 20, 2025 · 1 comment · Fixed by #22579
Closed

Effort limits for KinematicTrajectoryOptimization #22500

RussTedrake opened this issue Jan 20, 2025 · 1 comment · Fixed by #22579
Assignees
Labels
component: planning and control Optimization-based planning and control, and search- and sampling-based planning type: feature request

Comments

@RussTedrake
Copy link
Contributor

While this is technically possible now, it certainly isn't easy.

In order to be parallel with AddPositionBounds, AddVelocityBounds, etc, and to leverage the fact that we can create one shared_pointer constraint for all of the times, my proposal would be to add the following method to KinematicTrajectoryOptimization:

  /** Adds generic (nonlinear) constraints to enforce the effort limits defined
  in the plant at a sequence of normalized times, `s`:
  @verbatim
  B u_min ≤ M(q)v̇ + C(q, v)v - τ_g(q) - τ_app ≤ B u_max
  @endverbatim
  where q, v, and v̇ are evaluated at s. B is the plant's actuation matrix,
  u_min is MultibodyPlant::GetEffortLowerLimits(), u_max is
  MultibodyPlant::GetEffortUpperLimits(), and M, C, τ_g, and τ_app are the
  plant's mass matrix, Coriolis force, gravity, and applied force,
  respectively.

  `plant` and `plant_context` must remain valid for the lifetime of these
  constraints.

  @pre plant.is_finalized()
  @pre plant.num_positions() == num_positions()
  @pre B u_min ≤ B u_max
  */
  std::vector<std::vector<solvers::Binding<solvers::Constraint>>>
  AddEffortBoundsAtNormalizedTimes(const MultibodyPlant<double>& plant,
                                   const Eigen::Ref<const Eigen::VectorXd>& s,
                                   systems::Context<double>* plant_context);

cc @cohnt, @hongkai-dai ... in case you have any suggestions.

@RussTedrake RussTedrake added component: planning and control Optimization-based planning and control, and search- and sampling-based planning type: feature request labels Jan 20, 2025
@RussTedrake RussTedrake self-assigned this Jan 20, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 20, 2025
@aelvio
Copy link

aelvio commented Jan 21, 2025

This would be awesome and would definitely cover 90% of my usage needs! Thank you for considering it!

If possible, it would be nice to add custom bounding box constraints (or costs) to the effort beyond what is written in the MultibodyPlant. For instance, I'm imagining using the default effort limits at all of the control points to constrain the overall trajectory, but then adding tighter constraints (or a cost) at a few key normalized times to ensure that the trajectory hits a "balanced banking angle" where centrifugal and gravitational forces are balanced.

RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 26, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 27, 2025
For BsplineBasis and BsplineTrajectory.

Towards RobotLocomotion#22533 which is towards RobotLocomotion#22500.
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 27, 2025
For BsplineBasis and BsplineTrajectory.

Towards RobotLocomotion#22533 which is towards RobotLocomotion#22500.
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 27, 2025
For BsplineBasis and BsplineTrajectory.

Towards RobotLocomotion#22533 which is towards RobotLocomotion#22500.
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 27, 2025
For BsplineBasis and BsplineTrajectory.

Towards RobotLocomotion#22533 which is towards RobotLocomotion#22500.
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 28, 2025
For BsplineBasis and BsplineTrajectory.

Towards RobotLocomotion#22533 which is towards RobotLocomotion#22500.
RussTedrake added a commit to RussTedrake/drake that referenced this issue Jan 28, 2025
For BsplineBasis and BsplineTrajectory.

Towards RobotLocomotion#22533 which is towards RobotLocomotion#22500.
RussTedrake added a commit that referenced this issue Jan 28, 2025
For BsplineBasis and BsplineTrajectory.

Towards #22533 which is towards #22500.
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 1, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 1, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 2, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 8, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 8, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 8, 2025
RussTedrake added a commit to RussTedrake/drake that referenced this issue Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: planning and control Optimization-based planning and control, and search- and sampling-based planning type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants