planner_2dof_serial_joints.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2020, the neonavigation authors
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #include <algorithm>
31 #include <cmath>
32 #include <limits>
33 #include <list>
34 #include <memory>
35 #include <string>
36 #include <utility>
37 #include <vector>
38 
39 #include <omp.h>
40 
41 #include <ros/ros.h>
42 
43 #include <planner_cspace_msgs/PlannerStatus.h>
44 #include <trajectory_msgs/JointTrajectory.h>
45 #include <sensor_msgs/JointState.h>
47 
50 
52 
53 namespace planner_cspace
54 {
55 namespace planner_2dof_serial_joints
56 {
58 {
59 public:
61  using Ptr = std::shared_ptr<Planner2dofSerialJointsNode>;
62 
63 private:
66 
71 
74 
76  Astar::Gridmap<char, 0x40> cm_;
78 
79  float freq_;
80  float freq_min_;
82  float avg_vel_;
84  {
88  };
90 
91  std::string group_;
92 
93  bool debug_aa_;
94 
95  class LinkBody
96  {
97  protected:
98  class Vec3dof
99  {
100  public:
101  float x_;
102  float y_;
103  float th_;
104 
105  float dist(const Vec3dof& b)
106  {
107  return std::hypot(b.x_ - x_, b.y_ - y_);
108  }
109  };
110 
111  public:
112  float radius_[2];
113  float vmax_;
114  float length_;
115  std::string name_;
118  float current_th_;
119 
121  {
122  gain_.x_ = 1.0;
123  gain_.y_ = 1.0;
124  gain_.th_ = 1.0;
125  }
126  Vec3dof end(const float th) const
127  {
128  Vec3dof e = origin_;
129  e.x_ += cosf(e.th_ + th * gain_.th_) * length_;
130  e.y_ += sinf(e.th_ + th * gain_.th_) * length_;
131  e.th_ += th;
132  return e;
133  }
134  bool isCollide(const LinkBody b, const float th0, const float th1)
135  {
136  auto end0 = end(th0);
137  auto end1 = b.end(th1);
138  auto& end0r = radius_[1];
139  auto& end1r = b.radius_[1];
140  auto& origin0 = origin_;
141  auto& origin1 = b.origin_;
142  auto& origin0r = radius_[0];
143  auto& origin1r = b.radius_[0];
144 
145  if (end0.dist(end1) < end0r + end1r)
146  return true;
147  if (end0.dist(origin1) < end0r + origin1r)
148  return true;
149  if (end1.dist(origin0) < end1r + origin0r)
150  return true;
151 
152  // add side collision
153 
154  return false;
155  }
156  };
158 
159  planner_cspace_msgs::PlannerStatus status_;
160  sensor_msgs::JointState joint_;
164 
165  void cbJoint(const sensor_msgs::JointState::ConstPtr& msg)
166  {
167  int id[2] = { -1, -1 };
168  for (size_t i = 0; i < msg->name.size(); i++)
169  {
170  if (msg->name[i].compare(links_[0].name_) == 0)
171  id[0] = i;
172  else if (msg->name[i].compare(links_[1].name_) == 0)
173  id[1] = i;
174  }
175  if (id[0] == -1 || id[1] == -1)
176  {
177  ROS_ERROR("joint_state does not contain link group %s.", group_.c_str());
178  return;
179  }
180  links_[0].current_th_ = msg->position[id[0]];
181  links_[1].current_th_ = msg->position[id[1]];
182  has_joint_states_ = true;
183 
184  if ((replan_prev_ + replan_interval_ < ros::Time::now() ||
185  replan_prev_ == ros::Time(0)) &&
186  replan_interval_ > ros::Duration(0))
187  {
188  replan();
189  }
190  }
191  std::pair<ros::Duration, std::pair<float, float>> cmd_prev_;
192  trajectory_msgs::JointTrajectory traj_prev_;
193  int id_[2];
194  void cbTrajectory(const trajectory_msgs::JointTrajectory::ConstPtr& msg)
195  {
196  id_[0] = -1;
197  id_[1] = -1;
198  for (size_t i = 0; i < msg->joint_names.size(); i++)
199  {
200  if (msg->joint_names[i].compare(links_[0].name_) == 0)
201  id_[0] = i;
202  else if (msg->joint_names[i].compare(links_[1].name_) == 0)
203  id_[1] = i;
204  }
205  if (id_[0] == -1 || id_[1] == -1)
206  {
207  ROS_ERROR("joint_trajectory does not contains link group %s.", group_.c_str());
208  return;
209  }
210  if (msg->points.size() != 1)
211  {
212  ROS_ERROR("single trajectory point required.");
213  }
214  decltype(cmd_prev_) cmd;
215  cmd.first = msg->points[0].time_from_start;
216  cmd.second.first = msg->points[0].positions[id_[0]];
217  cmd.second.second = msg->points[0].positions[id_[1]];
218  if (cmd_prev_ == cmd)
219  return;
220  cmd_prev_ = cmd;
221  traj_prev_ = *msg;
222  avg_vel_ = -1.0;
223 
224  replan();
225  }
226  void replan()
227  {
228  if (!has_joint_states_)
229  return;
230 
231  replan_prev_ = ros::Time::now();
232  if (id_[0] == -1 || id_[1] == -1)
233  return;
234 
235  Astar::Vecf start(
236  links_[0].current_th_,
237  links_[1].current_th_);
239  static_cast<float>(traj_prev_.points[0].positions[id_[0]]),
240  static_cast<float>(traj_prev_.points[0].positions[id_[1]]));
241 
242  ROS_INFO("link %s: %0.3f, %0.3f", group_.c_str(),
243  traj_prev_.points[0].positions[id_[0]],
244  traj_prev_.points[0].positions[id_[1]]);
245 
246  ROS_INFO("Start searching");
247  std::list<Astar::Vecf> path;
248  if (makePlan(start, end, path))
249  {
250  ROS_INFO("Trajectory found");
251 
252  if (avg_vel_ < 0)
253  {
254  float pos_sum = 0;
255  for (auto it = path.begin(); it != path.end(); it++)
256  {
257  auto it_next = it;
258  it_next++;
259  if (it_next != path.end())
260  {
261  float diff[2], diff_max;
262  diff[0] = std::abs((*it_next)[0] - (*it)[0]);
263  diff[1] = std::abs((*it_next)[1] - (*it)[1]);
264  diff_max = std::max(diff[0], diff[1]);
265  pos_sum += diff_max;
266  }
267  }
268  if (traj_prev_.points[0].time_from_start <= ros::Duration(0))
269  {
270  avg_vel_ = std::min(links_[0].vmax_, links_[1].vmax_);
271  }
272  else
273  {
274  avg_vel_ = pos_sum / traj_prev_.points[0].time_from_start.toSec();
275  if (avg_vel_ > links_[0].vmax_)
276  avg_vel_ = links_[0].vmax_;
277  if (avg_vel_ > links_[1].vmax_)
278  avg_vel_ = links_[1].vmax_;
279  }
280  }
281 
282  trajectory_msgs::JointTrajectory out;
283  out.header = traj_prev_.header;
284  out.header.stamp = ros::Time(0);
285  out.joint_names.resize(2);
286  out.joint_names[0] = links_[0].name_;
287  out.joint_names[1] = links_[1].name_;
288  float pos_sum = 0.0;
289  for (auto it = path.begin(); it != path.end(); it++)
290  {
291  if (it == path.begin())
292  continue;
293 
294  trajectory_msgs::JointTrajectoryPoint p;
295  p.positions.resize(2);
296  p.velocities.resize(2);
297 
298  auto it_prev = it;
299  it_prev--;
300  auto it_next = it;
301  it_next++;
302 
303  float diff[2], diff_max;
304  diff[0] = std::abs((*it)[0] - (*it_prev)[0]);
305  diff[1] = std::abs((*it)[1] - (*it_prev)[1]);
306  diff_max = std::max(diff[0], diff[1]);
307  pos_sum += diff_max;
308 
309  if (it_next == path.end())
310  {
311  p.velocities[0] = 0.0;
312  p.velocities[1] = 0.0;
313  }
314  else
315  {
316  float dir[2], dir_max;
317  switch (point_vel_)
318  {
319  default:
320  case VEL_PREV:
321  dir[0] = ((*it)[0] - (*it_prev)[0]);
322  dir[1] = ((*it)[1] - (*it_prev)[1]);
323  break;
324  case VEL_NEXT:
325  dir[0] = ((*it_next)[0] - (*it)[0]);
326  dir[1] = ((*it_next)[1] - (*it)[1]);
327  break;
328  case VEL_AVG:
329  dir[0] = ((*it_next)[0] - (*it_prev)[0]);
330  dir[1] = ((*it_next)[1] - (*it_prev)[1]);
331  break;
332  }
333  dir_max = std::max(std::abs(dir[0]), std::abs(dir[1]));
334  float t = dir_max / avg_vel_;
335 
336  p.velocities[0] = dir[0] / t;
337  p.velocities[1] = dir[1] / t;
338  }
339  p.time_from_start = ros::Duration(pos_sum / avg_vel_);
340  p.positions[0] = (*it)[0];
341  p.positions[1] = (*it)[1];
342  out.points.push_back(p);
343  }
344  pub_trajectory_.publish(out);
345  }
346  else
347  {
348  trajectory_msgs::JointTrajectory out;
349  out.header = traj_prev_.header;
350  out.header.stamp = ros::Time(0);
351  out.joint_names.resize(2);
352  out.joint_names[0] = links_[0].name_;
353  out.joint_names[1] = links_[1].name_;
354  trajectory_msgs::JointTrajectoryPoint p;
355  p.positions.resize(2);
356  p.positions[0] = links_[0].current_th_;
357  p.positions[1] = links_[1].current_th_;
358  p.velocities.resize(2);
359  out.points.push_back(p);
360  pub_trajectory_.publish(out);
361 
362  ROS_WARN("Trajectory not found");
363  }
364 
365  pub_status_.publish(status_);
366  }
367 
368 public:
369  explicit Planner2dofSerialJointsNode(const std::string group_name)
370  : nh_()
371  , pnh_("~")
372  , tfl_(tfbuf_)
373  , has_joint_states_(false)
374  {
376  group_ = group_name;
377  ros::NodeHandle nh_group("~/" + group_);
378 
379  pub_trajectory_ = neonavigation_common::compat::advertise<trajectory_msgs::JointTrajectory>(
380  nh_, "joint_trajectory",
381  pnh_, "trajectory_out", 1, true);
382  sub_trajectory_ = neonavigation_common::compat::subscribe(
383  nh_, "trajectory_in",
384  pnh_, "trajectory_in", 1, &Planner2dofSerialJointsNode::cbTrajectory, this);
386  nh_, "joint_states",
387  pnh_, "joint", 1, &Planner2dofSerialJointsNode::cbJoint, this);
388 
389  pub_status_ = nh_group.advertise<planner_cspace_msgs::PlannerStatus>("status", 1, true);
390 
391  nh_group.param("resolution", resolution_, 128);
392  pnh_.param("debug_aa", debug_aa_, false);
393 
394  double interval;
395  pnh_.param("replan_interval", interval, 0.2);
396  replan_interval_ = ros::Duration(interval);
397  replan_prev_ = ros::Time(0);
398 
399  int queue_size_limit;
400  nh_group.param("queue_size_limit", queue_size_limit, 0);
401  as_.setQueueSizeLimit(queue_size_limit);
402 
403  status_.status = planner_cspace_msgs::PlannerStatus::DONE;
404 
405  cm_.reset(Astar::Vec(resolution_ * 2, resolution_ * 2));
406  as_.reset(Astar::Vec(resolution_ * 2, resolution_ * 2));
407  cm_.clear(0);
408 
409  nh_group.param("link0_name", links_[0].name_, std::string("link0"));
410  nh_group.param("link0_joint_radius", links_[0].radius_[0], 0.07f);
411  nh_group.param("link0_end_radius", links_[0].radius_[1], 0.07f);
412  nh_group.param("link0_length", links_[0].length_, 0.135f);
413  nh_group.param("link0_x", links_[0].origin_.x_, 0.22f);
414  nh_group.param("link0_y", links_[0].origin_.y_, 0.0f);
415  nh_group.param("link0_th", links_[0].origin_.th_, 0.0f);
416  nh_group.param("link0_gain_th", links_[0].gain_.th_, -1.0f);
417  nh_group.param("link0_vmax", links_[0].vmax_, 0.5f);
418  nh_group.param("link1_name", links_[1].name_, std::string("link1"));
419  nh_group.param("link1_joint_radius", links_[1].radius_[0], 0.07f);
420  nh_group.param("link1_end_radius", links_[1].radius_[1], 0.07f);
421  nh_group.param("link1_length", links_[1].length_, 0.27f);
422  nh_group.param("link1_x", links_[1].origin_.x_, -0.22f);
423  nh_group.param("link1_y", links_[1].origin_.y_, 0.0f);
424  nh_group.param("link1_th", links_[1].origin_.th_, 0.0f);
425  nh_group.param("link1_gain_th", links_[1].gain_.th_, 1.0f);
426  nh_group.param("link1_vmax", links_[1].vmax_, 0.5f);
427 
428  links_[0].current_th_ = 0.0;
429  links_[1].current_th_ = 0.0;
430  id_[0] = -1;
431  id_[1] = -1;
432 
433  ROS_INFO("link group: %s", group_.c_str());
434  ROS_INFO(" - link0: %s", links_[0].name_.c_str());
435  ROS_INFO(" - link1: %s", links_[1].name_.c_str());
436 
437  Astar::Vecf euclid_cost_coef;
438  nh_group.param("link0_coef", euclid_cost_coef[0], 1.0f);
439  nh_group.param("link1_coef", euclid_cost_coef[1], 1.5f);
440 
441  CostCoeff cc;
442  nh_group.param("weight_cost", cc.weight_cost_, 4.0f);
443  nh_group.param("expand", cc.expand_, 0.1f);
444 
445  std::string point_vel_mode;
446  nh_group.param("point_vel_mode", point_vel_mode, std::string("prev"));
447  std::transform(point_vel_mode.begin(), point_vel_mode.end(), point_vel_mode.begin(), ::tolower);
448  if (point_vel_mode.compare("prev") == 0)
449  point_vel_ = VEL_PREV;
450  else if (point_vel_mode.compare("next") == 0)
451  point_vel_ = VEL_NEXT;
452  else if (point_vel_mode.compare("avg") == 0)
453  point_vel_ = VEL_AVG;
454  else
455  ROS_ERROR("point_vel_mode must be prev/next/avg");
456 
457  ROS_INFO("Resolution: %d", resolution_);
458  Astar::Vec p;
459  for (p[0] = 0; p[0] < resolution_ * 2; p[0]++)
460  {
461  for (p[1] = 0; p[1] < resolution_ * 2; p[1]++)
462  {
463  Astar::Vecf pf;
464  grid2Metric(p, pf);
465 
466  if (links_[0].isCollide(links_[1], pf[0], pf[1]))
467  cm_[p] = 100;
468  // else if(pf[0] > M_PI || pf[1] > M_PI)
469  // cm_[p] = 50;
470  else
471  cm_[p] = 0;
472  }
473  }
474  for (p[0] = 0; p[0] < resolution_ * 2; p[0]++)
475  {
476  for (p[1] = 0; p[1] < resolution_ * 2; p[1]++)
477  {
478  if (cm_[p] != 100)
479  continue;
480 
481  Astar::Vec d;
482  int range = std::lround(cc.expand_ * resolution_ / (2.0 * M_PI));
483  for (d[0] = -range; d[0] <= range; d[0]++)
484  {
485  for (d[1] = -range; d[1] <= range; d[1]++)
486  {
487  Astar::Vec p2 = p + d;
488  if ((unsigned int)p2[0] >= (unsigned int)resolution_ * 2 ||
489  (unsigned int)p2[1] >= (unsigned int)resolution_ * 2)
490  continue;
491  int dist = std::max(std::abs(d[0]), abs(d[1]));
492  int c = std::floor(100.0 * (range - dist) / range);
493  if (cm_[p2] < c)
494  cm_[p2] = c;
495  }
496  }
497  }
498  }
499 
500  int range;
501  nh_group.param("range", range, 8);
502 
503  model_.reset(new GridAstarModel2DoFSerialJoint(
504  euclid_cost_coef,
505  resolution_,
506  cm_,
507  cc,
508  range));
509 
510  int num_threads;
511  nh_group.param("num_threads", num_threads, 1);
512  omp_set_num_threads(num_threads);
513  }
514 
515 private:
517  const int t0, const int t1,
518  float& gt0, float& gt1)
519  {
520  gt0 = (t0 - resolution_) * 2.0 * M_PI / static_cast<float>(resolution_);
521  gt1 = (t1 - resolution_) * 2.0 * M_PI / static_cast<float>(resolution_);
522  }
524  int& t0, int& t1,
525  const float gt0, const float gt1)
526  {
527  t0 = std::lround(gt0 * resolution_ / (2.0 * M_PI)) + resolution_;
528  t1 = std::lround(gt1 * resolution_ / (2.0 * M_PI)) + resolution_;
529  }
531  const Astar::Vec t,
532  Astar::Vecf& gt)
533  {
534  grid2Metric(t[0], t[1], gt[0], gt[1]);
535  }
537  Astar::Vec& t,
538  const Astar::Vecf gt)
539  {
540  metric2Grid(t[0], t[1], gt[0], gt[1]);
541  }
542  bool makePlan(const Astar::Vecf sg, const Astar::Vecf eg, std::list<Astar::Vecf>& path)
543  {
544  Astar::Vec s, e;
545  metric2Grid(s, sg);
546  metric2Grid(e, eg);
547  ROS_INFO("Planning from (%d, %d) to (%d, %d)",
548  s[0], s[1], e[0], e[1]);
549 
550  if (cm_[s] == 100)
551  {
552  ROS_WARN("Path plan failed (current status is in collision)");
553  status_.error = planner_cspace_msgs::PlannerStatus::PATH_NOT_FOUND;
554  return false;
555  }
556  if (cm_[e] == 100)
557  {
558  ROS_WARN("Path plan failed (goal status is in collision)");
559  status_.error = planner_cspace_msgs::PlannerStatus::PATH_NOT_FOUND;
560  return false;
561  }
562  Astar::Vec d = e - s;
563  d.cycle(resolution_, resolution_);
564 
565  std::vector<Astar::VecWithCost> starts;
566  starts.emplace_back(s);
567 
568  if (model_->cost(s, e, starts, e) >= model_->euclidCost(d))
569  {
570  path.push_back(sg);
571  path.push_back(eg);
572  if (s == e)
573  {
574  replan_prev_ = ros::Time(0);
575  }
576  return true;
577  }
578  std::list<Astar::Vec> path_grid;
579  // const auto ts = std::chrono::high_resolution_clock::now();
580  float cancel = std::numeric_limits<float>::max();
581  if (replan_interval_ >= ros::Duration(0))
582  cancel = replan_interval_.toSec();
583  if (!as_.search(
584  starts, e, path_grid, model_,
585  std::bind(&Planner2dofSerialJointsNode::cbProgress, this, std::placeholders::_1, std::placeholders::_2),
586  0, cancel, true))
587  {
588  ROS_WARN("Path plan failed (goal unreachable)");
589  status_.error = planner_cspace_msgs::PlannerStatus::PATH_NOT_FOUND;
590  return false;
591  }
592  // const auto tnow = std::chrono::high_resolution_clock::now();
593  // ROS_INFO("Path found (%0.3f sec.)",
594  // std::chrono::duration<float>(tnow - ts).count());
595 
596  bool first = false;
597  Astar::Vec n_prev = s;
598  path.push_back(sg);
599  int i = 0;
600  for (auto& n : path_grid)
601  {
602  if (!first)
603  {
604  first = true;
605  continue;
606  }
607  if (i == 0)
608  ROS_INFO(" next: %d, %d", n[0], n[1]);
609  Astar::Vec n_diff = n - n_prev;
610  n_diff.cycle(resolution_, resolution_);
611  Astar::Vec n2 = n_prev + n_diff;
612  n_prev = n2;
613 
614  Astar::Vecf p;
615  grid2Metric(n2, p);
616  path.push_back(p);
617  i++;
618  }
619  float prec = 2.0 * M_PI / static_cast<float>(resolution_);
620  Astar::Vecf egp = eg;
621  if (egp[0] < 0)
622  egp[0] += std::ceil(-egp[0] / M_PI * 2.0) * M_PI * 2.0;
623  if (egp[1] < 0)
624  egp[1] += std::ceil(-egp[1] / M_PI * 2.0) * M_PI * 2.0;
625  path.back()[0] += fmod(egp[0] + prec / 2.0, prec) - prec / 2.0;
626  path.back()[1] += fmod(egp[1] + prec / 2.0, prec) - prec / 2.0;
627 
628  if (debug_aa_)
629  {
630  Astar::Vec p;
631  for (p[0] = resolution_ / 2; p[0] < resolution_ * 3 / 2; p[0]++)
632  {
633  for (p[1] = resolution_ / 2; p[1] < resolution_ * 3 / 2; p[1]++)
634  {
635  bool found = false;
636  for (auto& g : path_grid)
637  {
638  if (g == p)
639  found = true;
640  }
641  if (p == s)
642  printf("\033[31ms\033[0m");
643  else if (p == e)
644  printf("\033[31me\033[0m");
645  else if (found)
646  printf("\033[34m*\033[0m");
647  else
648  printf("%d", cm_[p] / 11);
649  }
650  printf("\n");
651  }
652  printf("\n");
653  }
654 
655  return true;
656  }
657  bool cbProgress(const std::list<Astar::Vec>& /* path_grid */, const SearchStats& /* stats */)
658  {
659  return false;
660  }
661 };
662 } // namespace planner_2dof_serial_joints
663 } // namespace planner_cspace
664 
665 int main(int argc, char* argv[])
666 {
667  ros::init(argc, argv, "planner_2dof_serial_joints");
668  ros::NodeHandle pnh("~");
669 
670  std::vector<planner_cspace::planner_2dof_serial_joints::Planner2dofSerialJointsNode::Ptr> jys;
671  int n;
672  pnh.param("num_groups", n, 1);
673  for (int i = 0; i < n; i++)
674  {
675  std::string name;
676  pnh.param("group" + std::to_string(i) + "_name",
677  name, std::string("group") + std::to_string(i));
679 
681  jys.push_back(jy);
682  }
683 
684  ros::spin();
685 
686  return 0;
687 }
d
void cbTrajectory(const trajectory_msgs::JointTrajectory::ConstPtr &msg)
void cycle(const int res, const ArgList &...rest)
Definition: cyclic_vec.h:282
void grid2Metric(const int t0, const int t1, float &gt0, float &gt1)
void publish(const boost::shared_ptr< M > &message) const
f
bool search(const std::vector< VecWithCost > &ss, const Vec &e, std::list< Vec > &path, const typename GridAstarModelBase< DIM, NONCYCLIC >::Ptr &model, ProgressCallback cb_progress, const float cost_leave, const float progress_interval, const bool return_best=false)
Definition: grid_astar.h:169
XmlRpcServer s
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
IMETHOD Vector diff(const Vector &p_w_a, const Vector &p_w_b, double dt=1)
void setQueueSizeLimit(const size_t size)
Definition: grid_astar.h:164
ros::Subscriber subscribe(ros::NodeHandle &nh_new, const std::string &topic_new, ros::NodeHandle &nh_old, const std::string &topic_old, uint32_t queue_size, void(*fp)(M), const ros::TransportHints &transport_hints=ros::TransportHints())
#define ROS_WARN(...)
geometry_msgs::TransformStamped t
ROSCPP_DECL void spin(Spinner &spinner)
int main(int argc, char *argv[])
#define ROS_INFO(...)
bool param(const std::string &param_name, T &param_val, const T &default_val) const
void reset(const Vec size)
Definition: grid_astar.h:147
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool cbProgress(const std::list< Astar::Vec > &, const SearchStats &)
INLINE Rall1d< T, V, S > abs(const Rall1d< T, V, S > &x)
static Time now()
#define ROS_ERROR(...)
bool makePlan(const Astar::Vecf sg, const Astar::Vecf eg, std::list< Astar::Vecf > &path)
void metric2Grid(int &t0, int &t1, const float gt0, const float gt1)


planner_cspace
Author(s): Atsushi Watanabe
autogenerated on Wed May 12 2021 02:20:42