2 #include <trajopt/common.hpp>
3 #include <trajopt/json_marshal.hpp>
4 #include <trajopt_sco/optimizers.hpp>
133 return supported_term_types_;
155 TermInfo(
int supported_term_types) : supported_term_types_(supported_term_types)
160 static std::map<std::string, MakerFunc> name_to_maker_;
161 int supported_term_types_;
176 ProblemInfo(planning_scene::PlanningSceneConstPtr ps,
const std::string& pg)
193 sco::VarVector
GetVarRow(
int i,
int start_col,
int num_col)
195 return matrix_traj_vars.rblock(i, start_col, num_col);
200 return matrix_traj_vars.row(i);
205 return matrix_traj_vars.at(i, j);
209 return matrix_traj_vars;
214 return matrix_traj_vars.rows();
220 return matrix_traj_vars.cols();
230 return planning_scene_;
234 matrix_init_traj =
x;
238 return matrix_init_traj;
256 trajopt::VarArray matrix_traj_vars;
257 planning_scene::PlanningSceneConstPtr planning_scene_;
258 std::string planning_group_;
261 trajopt::TrajArray matrix_init_traj;
294 return std::make_shared<CartPoseTermInfo>();
333 return std::make_shared<JointPoseTermInfo>();
362 return std::make_shared<JointVelTermInfo>();
367 trajopt::TrajArray& init_traj);
planning_scene::PlanningSceneConstPtr GetPlanningScene()
sco::VarVector GetVarRow(int i, int start_col, int num_col)
Returns the values of the specified joints (start_col to num_col) for the specified timestep i.
int GetNumDOF()
Returns the problem DOF. This is the number of columns in the optization matrix. Note that this is no...
virtual ~TrajOptProblem()=default
trajopt::TrajArray GetInitTraj()
bool GetHasTime()
Returns TrajOptProb.has_time.
int GetActiveGroupNumDOF()
Returns the kinematic DOF of the active joint model group.
void SetInitTraj(const trajopt::TrajArray &x)
sco::VarVector GetVarRow(int i)
Returns the values of all joints for the specified timestep i.
int GetNumSteps()
Returns the number of steps in the problem. This is the number of rows in the optimization matrix.
trajopt::VarArray & GetVars()
void SetHasTime(bool tmp)
Sets TrajOptProb.has_time
sco::Var & GetVar(int i, int j)
Returns the value of the specified joint j for the specified timestep i.
Vec3fX< details::Vec3Data< double > > Vector3d
This namespace includes the central class for representing planning contexts.
MOVEIT_CLASS_FORWARD(TermInfo)
TrajOptProblemPtr ConstructProblem(const ProblemInfo &)
void generateInitialTrajectory(const ProblemInfo &pci, const std::vector< double > ¤t_joint_values, trajopt::TrajArray &init_traj)
int n_steps
Number of time steps (rows) in the optimization matrix.
double dt_upper_lim
The upper limit of 1/dt values allowed in the optimization.
double dt_lower_lim
The lower limit of 1/dt values allowed in the optimization.
bool use_time
If true, the last column in the optimization matrix will be 1/dt.
bool start_fixed
If true, first time step is fixed with a joint level constraint If this is false, the starting point ...
sco::ModelType convex_solver
This term is used when the goal frame is fixed in cartesian space.
static TermInfoPtr create()
Eigen::Vector3d rot_coeffs
Eigen::Vector3d pos_coeffs
coefficients for position and rotation
Eigen::Vector3d xyz
Cartesian position.
std::string link
Link which should reach desired pose.
Eigen::Isometry3d tcp
Static transform applied to the link.
Eigen::Vector4d wxyz
Rotation quaternion.
void addObjectiveTerms(TrajOptProblem &prob) override
Used to add term to pci from json.
int timestep
Timestep at which to apply term.
Type
Methods of initializing the optimization matrix. This defines how robot moves from the current state ...
trajopt::TrajArray data
Data used during initialization. Use depends on the initialization selected. This data will be used t...
Type type
Specifies the type of initialization to use.
double dt
Default value the final column of the optimization is initialized too if time is being used.
Joint space position cost Position operates on a single point (unlike velocity, etc)....
int last_step
Last time step to which the term is applied. Default: prob.GetNumSteps() - 1.
trajopt::DblVec upper_tols
Vector of position upper limits. Size should be the DOF of the system. Default: vector of 0's.
trajopt::DblVec coeffs
Vector of coefficients that scale the cost. Size should be the DOF of the system. Default: vector of ...
trajopt::DblVec targets
Vector of position targets. This is a required value. Size should be the DOF of the system.
trajopt::DblVec lower_tols
Vector of position lower limits. Size should be the DOF of the system. Default: vector of 0's.
int first_step
First time step to which the term is applied. Default: 0.
static TermInfoPtr create()
JointPoseTermInfo()
Initialize term with it's supported types.
void addObjectiveTerms(TrajOptProblem &prob) override
Converts term info into cost/constraint and adds it to trajopt problem.
static TermInfoPtr create()
void addObjectiveTerms(TrajOptProblem &prob) override
Converts term info into cost/constraint and adds it to trajopt problem.
trajopt::DblVec coeffs
Vector of coefficients that scale the cost. Size should be the DOF of the system. Default: vector of ...
trajopt::DblVec lower_tols
Vector of velocity lower limits. Size should be the DOF of the system. Default: vector of 0's.
JointVelTermInfo()
Initialize term with it's supported types.
trajopt::DblVec targets
Vector of velocity targets. This is a required value. Size should be the DOF of the system.
trajopt::DblVec upper_tols
Vector of velocity upper limits. Size should be the DOF of the system. Default: vector of 0's.
int last_step
Last time step to which the term is applied. Default: prob.GetNumSteps() - 1.
int first_step
First time step to which the term is applied. Default: 0.
std::vector< TermInfoPtr > cnt_infos
ProblemInfo(planning_scene::PlanningSceneConstPtr ps, const std::string &pg)
std::vector< TermInfoPtr > cost_infos
planning_scene::PlanningSceneConstPtr planning_scene
std::string planning_group_name
sco::BasicTrustRegionSQPParameters opt_info
static void RegisterMaker(const std::string &type, MakerFunc)
virtual void addObjectiveTerms(TrajOptProblem &prob)=0
virtual ~TermInfo()=default
TermInfo & operator=(const TermInfo &)=default
TermInfoPtr(*)(void) MakerFunc
TermInfo(TermInfo &&)=default
static TermInfoPtr fromName(const std::string &type)
TermInfo & operator=(TermInfo &&)=default
TermInfo(int supported_term_types)
TermInfo(const TermInfo &)=default