dynamics_reachability.cpp
Go to the documentation of this file.
2 
3 
4 
6 {
8  : ReachabilityPlugin("dynamics_reachability")
9 {
10 }
11 
12 bool DynamicsReachability::loadParams(const ParameterSet& params)
13 {
14  if (!ReachabilityPlugin::loadParams(params))
15  return false;
16 
17  params.getParam("dynamics/body/max_vel", max_body_vel_sq, 0.0);
19  params.getParam("dynamics/body/max_acc", max_body_acc_sq, 0.0);
21  return true;
22 }
23 
24 bool DynamicsReachability::isReachable(const State& current, const State& next) const
25 {
26  if (max_body_vel_sq > 0.0)
27  {
28  const geometry_msgs::Vector3& v = next.getBodyVelocity();
29  if ((v.x*v.x + v.y*v.y + v.z*v.z) > max_body_vel_sq)
30  return false;
31  }
32 
33  if (max_body_acc_sq > 0.0 && next.getStepDuration() > 0.0)
34  {
35  const geometry_msgs::Vector3& v0 = current.getBodyVelocity();
36  const geometry_msgs::Vector3& v1 = next.getBodyVelocity();
37 
38  geometry_msgs::Vector3 acc;
39  acc.x = (v1.x-v0.x)/next.getStepDuration();
40  acc.y = (v1.y-v0.y)/next.getStepDuration();
41  acc.z = (v1.z-v0.z)/next.getStepDuration();
42 
43  if ((acc.x*acc.x + acc.y*acc.y + acc.z*acc.z) > max_body_acc_sq)
44  return false;
45  }
46 
47  return true;
48 }
49 }
50 
51 #include <pluginlib/class_list_macros.h>
52 PLUGINLIB_EXPORT_CLASS(vigir_footstep_planning::DynamicsReachability, vigir_footstep_planning::ReachabilityPlugin)
bool loadParams(const ParameterSet &params=vigir_generic_params::ParameterSet()) override
bool isReachable(const State &current, const State &next) const override


vigir_footstep_planning_default_plugins
Author(s): Alexander Stumpf
autogenerated on Sun Nov 17 2019 03:30:01