libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
costMapPlot.h
1 #ifndef COSTMAPPLOT_H
2 #define COSTMAPPLOT_H
3 
4 
5 #include "API/Device/robot.hpp"
6 
7 #include "Logging/Logger.h"
8 #include "Logging/socketplot.h"
9 
10 
15 {
16  MOVE3D_STATIC_LOGGER;
17 public:
18  CostMapPlot(const std::string &name);
19  ~CostMapPlot();
20 
21  void start();
22 
26  void plotCurrentTraj();
27 
28  void addDof(Robot *r,Joint* j, int dof_index, double min=-std::numeric_limits<double>::infinity(), double max=std::numeric_limits<double>::infinity(), double step=0);
29 
35  double firstSample(std::vector<double> &dof_values);
41  double nextSample(std::vector<double> &dof_values);
48  double moveJointNextSample(unsigned int i,bool &reached_extreme);
49  double getDofValue(unsigned int i);
50 
51  void updateRobots();
52  void saveRobotConfs();
53  void restoreRobotConfs();
54 
55  unsigned int defaultSampleNbPerJnt() const;
56  void setDefaultSampleNbPerJnt(unsigned int defaultSampleNbPerJnt);
57 
58  void setAndUpdateJointDof(Joint* j,int dof,double val);
59 
60  static void test1();
61  static void test2();
62 
63 private:
64  SocketPlot *_socketPlot;
65  SocketPlot *_socketPlotTraj;
66  std::vector<std::pair<Joint*,int> > _dofs;
67  std::vector<double> _curValues;
68  std::set<Robot*> _robots_to_update;
69  bool _reached_end;
70  unsigned int _defaultSampleNbPerJnt;
71  std::vector<Configuration> _savedConf;
72 
73  std::vector<double> _steps,_min,_max;
74  std::string _name,_name_traj;
75 };
76 
77 #endif // COSTMAPPLOT_H
double moveJointNextSample(unsigned int i, bool &reached_extreme)
moveJointNextSample
Definition: costMapPlot.cpp:231
Definition: socketplot.h:11
void plotCurrentTraj()
plot the cost of the trajcetory projected into the selected DoFs
Definition: costMapPlot.cpp:57
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
double nextSample(std::vector< double > &dof_values)
nextSample move joints to next sample position
Definition: costMapPlot.cpp:125
This file implements macros to help with the logging, in a way similar to ROS, using log4cxx...
double firstSample(std::vector< double > &dof_values)
firstSample move joints to the initial position for the sampling and compute cost ...
Definition: costMapPlot.cpp:103
This class holds a Joint and is associated with a Body (Link) It's the basic element of a kinematic c...
Definition: joint.hpp:27
The CostMapPlot class samples the configuration space on a few DoF to plot a costmap.
Definition: costMapPlot.h:14