chomp_parameters.cpp
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Mrinal Kalakrishnan */
36 
38 
39 namespace chomp
40 {
42 {
44  max_iterations_ = 50;
48  learning_rate_ = 0.01;
49 
53  ridge_factor_ = 0.0;
54  use_pseudo_inverse_ = false;
56 
57  joint_update_limit_ = 0.1;
58  min_clearance_ = 0.2;
59  collision_threshold_ = 0.07;
61  filter_mode_ = false;
62  trajectory_initialization_method_ = std::string("quintic-spline");
65 }
66 
68 
69 void ChompParameters::setRecoveryParams(double learning_rate, double ridge_factor, int planning_time_limit,
70  int max_iterations)
71 {
72  this->learning_rate_ = learning_rate;
73  this->ridge_factor_ = ridge_factor;
74  this->planning_time_limit_ = planning_time_limit;
75  this->max_iterations_ = max_iterations;
76 }
77 
78 const std::vector<std::string> ChompParameters::VALID_INITIALIZATION_METHODS{ "quintic-spline", "linear", "cubic",
79  "fillTrajectory" };
80 
82 {
83  if (std::find(VALID_INITIALIZATION_METHODS.cbegin(), VALID_INITIALIZATION_METHODS.cend(), method) !=
85  {
86  this->trajectory_initialization_method_ = std::move(method);
87  return true;
88  }
89  return false;
90 }
91 } // namespace chomp
chomp::ChompParameters::max_iterations_after_collision_free_
int max_iterations_after_collision_free_
Definition: chomp_parameters.h:133
chomp::ChompParameters::planning_time_limit_
double planning_time_limit_
Definition: chomp_parameters.h:130
chomp_parameters.h
chomp::ChompParameters::max_recovery_attempts_
int max_recovery_attempts_
Definition: chomp_parameters.h:162
chomp::ChompParameters::smoothness_cost_velocity_
double smoothness_cost_velocity_
Definition: chomp_parameters.h:142
chomp::ChompParameters::collision_threshold_
double collision_threshold_
the minimum distance that needs to be maintained to avoid obstacles
Definition: chomp_parameters.h:154
chomp::ChompParameters::pseudo_inverse_ridge_factor_
double pseudo_inverse_ridge_factor_
enable pseudo inverse calculations or not.
Definition: chomp_parameters.h:150
chomp
Definition: chomp_cost.h:43
chomp::ChompParameters::~ChompParameters
virtual ~ChompParameters()
chomp::ChompParameters::ChompParameters
ChompParameters()
Definition: chomp_parameters.cpp:73
chomp::ChompParameters::setRecoveryParams
void setRecoveryParams(double learning_rate, double ridge_factor, int planning_time_limit, int max_iterations)
Definition: chomp_parameters.cpp:101
chomp::ChompParameters::obstacle_cost_weight_
double obstacle_cost_weight_
Definition: chomp_parameters.h:137
chomp::ChompParameters::smoothness_cost_jerk_
double smoothness_cost_jerk_
variables associated with the cost in acceleration
Definition: chomp_parameters.h:144
chomp::ChompParameters::joint_update_limit_
double joint_update_limit_
set the ridge factor if pseudo inverse is enabled
Definition: chomp_parameters.h:152
chomp::ChompParameters::enable_failure_recovery_
bool enable_failure_recovery_
trajectory initialization method to be specified
Definition: chomp_parameters.h:160
chomp::ChompParameters::filter_mode_
bool filter_mode_
the collision threshold cost that needs to be mainted to avoid collisions
Definition: chomp_parameters.h:155
chomp::ChompParameters::use_pseudo_inverse_
bool use_pseudo_inverse_
the noise added to the diagnal of the total quadratic cost matrix in the objective function
Definition: chomp_parameters.h:149
chomp::ChompParameters::smoothness_cost_weight_
double smoothness_cost_weight_
Definition: chomp_parameters.h:135
chomp::ChompParameters::ridge_factor_
double ridge_factor_
Definition: chomp_parameters.h:148
chomp::ChompParameters::max_iterations_
int max_iterations_
maximum time the optimizer can take to find a solution before terminating
Definition: chomp_parameters.h:131
chomp::ChompParameters::use_stochastic_descent_
bool use_stochastic_descent_
variables associated with the cost in jerk
Definition: chomp_parameters.h:145
chomp::ChompParameters::setTrajectoryInitializationMethod
bool setTrajectoryInitializationMethod(std::string method)
Definition: chomp_parameters.cpp:113
chomp::ChompParameters::min_clearance_
double min_clearance_
set the update limit for the robot joints
Definition: chomp_parameters.h:153
chomp::ChompParameters::learning_rate_
double learning_rate_
Definition: chomp_parameters.h:139
chomp::ChompParameters::VALID_INITIALIZATION_METHODS
static const std::vector< std::string > VALID_INITIALIZATION_METHODS
Definition: chomp_parameters.h:157
chomp::ChompParameters::smoothness_cost_acceleration_
double smoothness_cost_acceleration_
variables associated with the cost in velocity
Definition: chomp_parameters.h:143
chomp::ChompParameters::trajectory_initialization_method_
std::string trajectory_initialization_method_
Definition: chomp_parameters.h:158


chomp_motion_planner
Author(s): Gil Jones , Mrinal Kalakrishnan
autogenerated on Sat Mar 15 2025 02:26:05