-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmstar_type_defs.hpp
62 lines (48 loc) · 1.78 KB
/
mstar_type_defs.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef MSTAR_TYPE_DEFS
#define MSTAR_TYPE_DEFS
/**************************************************************************
* Provides type defs that are used in multiple files
*************************************************************************/
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <vector>
#include <chrono>
namespace mstar{
/**
* Defines the graph type for individual robots.
*
* Assumes robot positions are indicated by integers, costs by doubles,
* and assumes that the edge_weight property is filled
*/
typedef boost::adjacency_list<
boost::vecS, boost::vecS, boost::bidirectionalS, boost::no_property,
boost::property<boost::edge_weight_t, double>> Graph;
// type that defines the position of the robot
typedef int RobCoord;
// represents the coordinate of an OD node, also used to index graphs
struct OdCoord{
std::vector<RobCoord> coord, move_tuple;
OdCoord(std::vector<RobCoord> in_coord, std::vector<RobCoord> in_move){
coord = in_coord;
move_tuple = in_move;
}
OdCoord(): coord(), move_tuple(){}
bool operator==(const OdCoord &other) const{
return (coord == other.coord) && (move_tuple == other.move_tuple);
}
bool is_standard() const{
return move_tuple.size() == 0;
}
};
// Holds a path in the joint configuration space
typedef std::vector<OdCoord> OdPath;
// defines a single set of mutually colliding robots.
// Must be sorted in order of increasing value for logic to hold
typedef std::set<uint> ColSetElement;
// Defines a full collision set
typedef std::vector<ColSetElement> ColSet;
// defines times for checking purposes
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
}
#endif