trajopt icon indicating copy to clipboard operation
trajopt copied to clipboard

Minimise Cartesian path length

Open blooop opened this issue 6 years ago • 2 comments

So far I've been using cart_vel and and joint_vel constraints to minimise the path length.

  {
        "type": "joint_vel",
        "params":
            {
                "targets": [0],
                "coeffs": [1]
            }
    }
    {
        "type": "cart_vel",
        "name": "cart_vel",
        "params": {
            "max_displacement": .15,
            "first_step": 0,
            "last_step": self.n_steps - 1,  # inclusive
            "link": ee
    }
 

I've had a look in the code for a constraint to minimise the Cartesian path length but the closest I've found is "type": "cart_pose" which has a completely different use. I would expect it to be called cart_pos and operate in the same way as cart_vel.

Does this type of constraint exist?

Thanks, Austin

blooop avatar Aug 08 '19 14:08 blooop

Cartesian velocity should minimize cartesian path length as it just assumes the timestep is 1. That said, I have not personally used it too much. It looks like the coeffs are not exposed for that cost at the moment. If it is not working, that could be the issue. They are set to all ones in problem_description at prob.addCost

If you want to set a true cartesian velocity, you would need to set TT_USE_TIME, but time parameterization has been implemented for cartesian moves yet.

mpowelson avatar Sep 12 '19 14:09 mpowelson

Thanks, I will look into it.

blooop avatar Sep 15 '19 09:09 blooop