31 #include <stomp_core/utils.h> 38 namespace update_filters
41 double DEFAULT_TIME_STEP = 1.0;
44 ControlCostProjection::ControlCostProjection():
45 name_(
"ControlCostProjectionMatrix"),
52 ControlCostProjection::~ControlCostProjection()
57 bool ControlCostProjection::initialize(moveit::core::RobotModelConstPtr robot_model_ptr,
60 robot_model_ = robot_model_ptr;
61 group_name_ = group_name;
76 bool ControlCostProjection::setMotionPlanRequest(
const planning_scene::PlanningSceneConstPtr&
planning_scene,
77 const moveit_msgs::MotionPlanRequest &req,
79 moveit_msgs::MoveItErrorCodes& error_code)
83 stomp_core::generateSmoothingMatrix(num_timesteps_,DEFAULT_TIME_STEP,projection_matrix_M_);
86 projection_matrix_M_.topRows(1) = Eigen::VectorXd::Zero(num_timesteps_).transpose();
87 projection_matrix_M_(0,0) = 1.0;
88 projection_matrix_M_.bottomRows(1) = Eigen::VectorXd::Zero(num_timesteps_).transpose();
89 projection_matrix_M_(num_timesteps_ -1 ,num_timesteps_ -1 ) = 1;
91 error_code.val = error_code.SUCCESS;
95 bool ControlCostProjection::filter(std::size_t start_timestep,std::size_t num_timesteps,
int iteration_number,
96 const Eigen::MatrixXd& parameters,
97 Eigen::MatrixXd& updates,
101 for(
auto d = 0u;
d < updates.rows();
d++)
103 updates.row(
d).transpose() = projection_matrix_M_ * (updates.row(
d).transpose());
Interface class which applies filtering methods to the update parameters before it is added onto the ...
PLUGINLIB_EXPORT_CLASS(test_moveit_controller_manager::TestMoveItControllerManager, moveit_controller_manager::MoveItControllerManager)
This defines a control cost projection update filter.
virtual bool configure(const XmlRpc::XmlRpcValue &config) override
Sets internal members of the plugin from the configuration data.