47 float x, y, z, rx, ry, rz, rw;
49 pose[0] >> x; pose[1] >> y; pose[2] >> z;
50 pose[3] >> rx; pose[4] >> ry; pose[5] >> rz; pose[6] >> rw;
52 x = pose[0].as<
float>(); y = pose[1].as<
float>(); z = pose[2].as<
float>();
53 rx= pose[3].as<
float>(); ry= pose[4].as<
float>(); rz= pose[5].as<
float>(); rw = pose[6].as<
float>();
55 Eigen::Vector3f
p(x, y, z);
56 Eigen::Quaternionf q(rw, rx, ry, rz);
57 Eigen::Affine3f trans = Eigen::Translation3f(
p) * Eigen::AngleAxisf(q);
62 std::vector<int>
addIndices(
const std::vector<int>& a,
63 const std::vector<int>& b)
65 std::set<int> all(b.begin(), b.end());
66 for (
size_t i = 0;
i < a.size();
i++) {
69 return std::vector<int>(all.begin(), all.end());
72 pcl::PointIndices::Ptr
addIndices(
const pcl::PointIndices& a,
73 const pcl::PointIndices& b)
75 std::vector<int> indices =
addIndices(a.indices, b.indices);
76 pcl::PointIndices::Ptr ret(
new pcl::PointIndices);
77 ret->indices = indices;
81 std::vector<int>
subIndices(
const std::vector<int>& a,
82 const std::vector<int>& b)
84 std::set<int> all(a.begin(), a.end());
85 for (
size_t i = 0;
i < b.size();
i++) {
86 std::set<int>::iterator it = all.find(b[
i]);
87 if (it != all.end()) {
91 return std::vector<int>(all.begin(), all.end());
94 pcl::PointIndices::Ptr
subIndices(
const pcl::PointIndices& a,
95 const pcl::PointIndices& b)
97 std::vector<int> indices =
subIndices(a.indices, b.indices);
98 pcl::PointIndices::Ptr ret(
new pcl::PointIndices);
99 ret->indices = indices;
110 return boost::accumulators::mean(
acc_);
115 return boost::accumulators::min(
acc_);
120 return boost::accumulators::max(
acc_);
125 return boost::accumulators::count(
acc_);
130 return boost::accumulators::variance(
acc_);
134 const int from_index_arg,
135 std::vector<int>& to_indices_arg,
136 std::set<int>& output_set)
140 for (IntegerGraphMap::iterator it = onedirectional_map.begin();
141 it != onedirectional_map.end();
143 int from_index = it->first;
144 std::vector<int> to_indices = it->second;
145 for (
size_t i = 0;
i < to_indices.size();
i++) {
146 int to_index = to_indices[
i];
147 if (onedirectional_map.find(to_index) == onedirectional_map.end()) {
149 onedirectional_map[to_index] = std::vector<int>();
151 if (std::find(onedirectional_map[to_index].begin(),
152 onedirectional_map[to_index].
end(),
153 from_index) == onedirectional_map[to_index].
end()) {
154 onedirectional_map[to_index].push_back(from_index);
165 const int from_index,
166 std::vector<int>& to_indices,
167 std::set<int>& output_set)
169 output_set.insert(from_index);
170 for (
size_t i = 0;
i < to_indices.size();
i++) {
171 int to_index = to_indices[
i];
172 if (output_set.find(to_index) == output_set.end()) {
173 output_set.insert(to_index);
175 std::vector<int> next_indices = graph_map[to_index];
185 std::vector<std::set<int> >& output_sets)
187 std::set<int> duplication_check_set;
188 for (IntegerGraphMap::iterator it = graph_map.begin();
189 it != graph_map.end();
191 int from_index = it->first;
192 if (duplication_check_set.find(from_index)
193 == duplication_check_set.end()) {
194 std::set<int> new_graph_set;
197 output_sets.push_back(new_graph_set);
199 addSet<int>(duplication_check_set, new_graph_set);
205 buf_(buf_len), buf_len_(buf_len)
209 SeriesedBoolean::~SeriesedBoolean()
213 void SeriesedBoolean::addValue(
bool val)
215 buf_.push_front(val);
218 bool SeriesedBoolean::isAllTrueFilled()
220 return (buf_.size() == buf_len_ && getValue());
223 bool SeriesedBoolean::getValue()
225 if (buf_.size() == 0) {
229 for (boost::circular_buffer<bool>::iterator it = buf_.begin();
240 void SeriesedBoolean::clear()