trajopt | Trajectory Optimization

 by   joschu C++ Version: v0.2 License: Non-SPDX

kandi X-RAY | trajopt Summary

kandi X-RAY | trajopt Summary

trajopt is a C++ library. trajopt has no bugs, it has no vulnerabilities and it has low support. However trajopt has a Non-SPDX License. You can download it from GitHub.

Trajectory Optimization
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              trajopt has a low active ecosystem.
              It has 307 star(s) with 156 fork(s). There are 20 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 25 open issues and 8 have been closed. On average issues are closed in 166 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of trajopt is v0.2

            kandi-Quality Quality

              trajopt has 0 bugs and 0 code smells.

            kandi-Security Security

              trajopt has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              trajopt code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              trajopt has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              trajopt releases are not available. You will need to build from source code and install.
              It has 6879 lines of code, 334 functions and 84 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of trajopt
            Get all kandi verified functions for this library.

            trajopt Key Features

            No Key Features are available at this moment for trajopt.

            trajopt Examples and Code Snippets

            No Code Snippets are available at this moment for trajopt.

            Community Discussions

            QUESTION

            MultibodyPlant’s dynamics as part of a Python function/lambda constraint in a MathematicalProgram for direct collocation from scratch
            Asked 2022-Feb-13 at 15:49

            I'm trying to implement direct collocation from scratch in a MathematicalProgram such that each constraint is a Python function, meaning that I can get the gradient of each constraint and cost with respect to their inputs. My goal is to use these gradients for a downstream task.

            I'm converting the "Direct Collocation for the Pendulum" part of this notebook: https://github.com/RussTedrake/underactuated/blob/master/trajopt.ipynb to a MathematicalProgram. I've been able to convert the cost and constraints to lambdas instead of Formulas. For instance:

            ...

            ANSWER

            Answered 2022-Feb-13 at 15:49

            It should definitely be possible to implement the DirectCollocation constraint in python. This notebook has a bunch of relevant examples of using python functions as constraints; it could help. But it should be a fairly straightforward port of the DirectCollocationConstraint::Eval you've found in C++.

            But you can also always get the gradients from the constraints that are being added by DirectCollocation. That class is just a helper class that makes it easier to set up the MathematicalProgram for you. You can still get that program back out and evaluate any of the constraints individually if you like. I'm not convinced you get anything by reimplementing it yourself, and will certainly have worse performance in python.

            Source https://stackoverflow.com/questions/71085209

            QUESTION

            Turning some of the states in a Drake system into inputs
            Asked 2021-Aug-22 at 10:53

            Consider an existing Drake System (for example MultibodyPlant). Is there a way to wrap that System inside a Diagram in such a way as to convert some of the states of the internal System to be inputs instead, i.e. set directly from input ports of the outer Diagram?

            The motivation would be essentially to make a change in modeling decisions. For example, a quadrotor is sometimes considered to have its angular rates and collective thrust as inputs, instead of the collective thrust and body moments (or similarly, individual rotor commands).

            In a more complex system, perhaps I might assume I have instantaneous control over certain velocities (e.g. internal, fully-actuated joints with fast dynamics), but still want to model the entire multibody system's dynamics accounting for the current choice of velocity in terms of Coriolis terms etc.

            What I'm getting at is actually very similar to the modeling choice for the elevator in the Flat-Plate Glider Model - but I'd like to avoid manually implementing a LeafSystem because my system has nontrivial multibody dynamics.

            My sense is that this may not be possible since I don't know of any way for a Diagram to interfere with the internal dynamics of a System, so "deleting" a state and promoting it to an input seems impossible. But I thought there might be some clever method to do this.

            Thanks in advance!

            ...

            ANSWER

            Answered 2021-Aug-22 at 10:53

            I agree with your analysis. The simplest answer is "no" -- systems that declare state cannot be post-hoc exploded to have that state come from an input port. But for the specific examples that you mention, there are a few possibilities / related ideas.

            The first is the notion of a prescribed motion constraint -- e.g. that one can set the positions/velocities of joints in a MultibodyPlant directly. We don't implement that yet, unfortunately, but it is a reasonable request that we've discussed occasionally (here is one example: https://github.com/RobotLocomotion/drake/issues/14694).

            As you say, you could implement a PD controller just outside of the system to achieve the desired effect. The only real difference between this and the way that we would implement the prescribed motion constraint internally, is that we can choose the gains well and inform the solver about that constraint directly.

            Another possibility is to implement a force element that works "inside" the plant and accepts an input port. This would allow you to apply forces to implement your modeling ideas even in ways that are not possible through the actuation_input_port (e.g. not achievable by a declared actuator).

            The glider example you link is a good one. In that case, I was very worried about having a model that avoided even declaring the velocity of the elevator as state (since our verification methods scale in complexity with the dimension of the state space). For now, that still requires writing a bespoke LeafSystem implementation.

            Source https://stackoverflow.com/questions/68824034

            QUESTION

            MathematicalProgram with MinimumDistanceConstraint: can you use more general convex shapes with AutoDiff?
            Asked 2020-May-22 at 14:51

            I'm trying to port trajectory optimization code originally written for TrajOpt into Drake. One of the nice things about TrajOpt is that it could solve SQP trajectory optimization problems with a constraint enforcing a minimum distance between the robot and surrounding obstacles, and it supported a pretty broad range of geometries (all the standard convex primitives plus simple convex meshes). For a number of reasons, TrajOpt is no longer the right choice for my project, so I'm porting my trajectory optimization code over to Drake. I think MinimumDistanceConstraint is what I want to replicate this functionality, but it seems that Drake allows AutoDiffXd signed distance queries only for spheres and half-spaces, not for more general convex shapes (like boxes or cylinders).

            All of my other constraints support AutoDiff (I have some custom constraints for "probability of collision," but those provide an analytical derivative that can be used in an AutoDiff). In order to add a MinimumDistanceConstraint that supports more general geometry, would I have to formulate the MathematicalProgram entirely with doubles? Would that slow down the performance of the solver (e.g. by having to do finite differences instead of using the gradient information in AutoDiffXd)?

            In an ideal world, I'd like to avoid resorting to "bubble-wrapping" my robot and environment (replacing all the collision geometry with spheres), since the runtime of the custom constraints I'm using scales with the number of collide-able pairs in the scene (I'm currently using convex geometry to keep this number relatively low).

            Any help would be appreciated!

            ...

            ANSWER

            Answered 2020-May-22 at 14:51

            but it seems that Drake allows AutoDiffXd signed distance queries only for spheres and half-spaces, not for more general convex shapes (like boxes or cylinders)

            1. I think MinimumDistanceConstraint can handle more general geometries (including boxes and cylinders) for MultibodyPlant and SceneGraph. It calls FCL to compute the signed distance between these geometries (including witness points). It is true that these signed distance queries don't support AutodiffXd yet, but only double type. But as you will see later, you don't need the signed distance query with AutoDiffXd to compute the gradient of the distance.
            2. You could try to construct MinimumDistanceConstraint for a MultibodyPlant with this API. Although you use MultibodyPlant not MultibodyPlant, MinimumDistanceConstraint can still evaluate with AutodiffXd. Specifically, it computes the gradient of the signed distance here. To compute the gradient of the signed distance query, the signed distance query doesn't need to support AutoDiffXd. We can compute the gradient using the witness points and the normal vectors as

            Source https://stackoverflow.com/questions/61902028

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install trajopt

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/joschu/trajopt.git

          • CLI

            gh repo clone joschu/trajopt

          • sshUrl

            git@github.com:joschu/trajopt.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link