ed
ed.cpp
Go to the documentation of this file.
1 #include <ros/advertise_service_options.h>
2 #include <ros/callback_queue.h>
3 #include <ros/init.h>
4 #include <ros/node_handle.h>
5 #include <ros/rate.h>
6 #include <ros/service.h>
7 
8 #include "ed/server.h"
9 
10 #include <ed/world_model.h>
11 #include <ed/measurement.h>
12 
13 // Query
14 #include <ed/entity.h>
15 #include <ed_msgs/SimpleQuery.h>
18 #include <geolib/datatypes.h>
21 
22 #include <ed_msgs/Query.h>
23 #include "ed/io/json_writer.h"
24 
25 // Update
26 #include <ed_msgs/UpdateSrv.h>
27 #include "ed/io/json_reader.h"
28 #include "ed/update_request.h"
29 
30 // Reset
31 #include <ed_msgs/Reset.h>
32 
33 // Configure
34 #include <ed_msgs/Configure.h>
35 
36 // Loop
37 #include <ed/event_clock.h>
38 
39 // Plugin loading
40 #include <ed/plugin.h>
41 #include <ed_msgs/LoadPlugin.h>
43 
44 #include <set>
45 #include <signal.h>
46 #include <stdio.h>
47 #include <execinfo.h>
48 #include <signal.h>
49 #include <stdlib.h>
50 #include <unistd.h>
51 #include <boost/thread.hpp>
52 #include "ed/error_context.h"
53 
55 
56 boost::thread::id main_thread_id;
57 
60 
61 // ----------------------------------------------------------------------------------------------------
62 
63 bool srvReset(ed_msgs::Reset::Request& req, ed_msgs::Reset::Response& /*res*/)
64 {
65  ed_wm->reset(req.keep_all_shapes);
66  return true;
67 }
68 
69 // ----------------------------------------------------------------------------------------------------
70 
71 bool srvUpdate(ed_msgs::UpdateSrv::Request& req, ed_msgs::UpdateSrv::Response& res)
72 {
73  ed::io::JSONReader r(req.request.c_str());
74 
75  if (!r.ok())
76  {
77  res.response = r.error();
78  return true;
79  }
80 
81  ed::UpdateRequest update_req;
82 
83  if (r.readArray("entities"))
84  {
85  while(r.nextArrayItem())
86  {
87  std::string id;
88  if (!r.readValue("id", id))
89  {
90  res.response += "Entities should have field 'id'.\n";
91  continue;
92  }
93 
94  std::string action;
95  if (r.readValue("action", action))
96  {
97  if (action == "remove")
98  update_req.removeEntity(id);
99  else
100  res.response += "Unknown action '" + action + "'.\n";
101  }
102 
103  std::string type;
104  if (r.readValue("type", type))
105  {
106  update_req.setType(id, type);
107  }
108 
109  if (r.readGroup("pose"))
110  {
111  double x, y, z;
112  std::string remove;
113  if (r.readValue("x", x) && r.readValue("y", y) && r.readValue("z", z))
114  {
116  pose.t = geo::Vector3(x, y, z);
117 
118  double X, Y, Z;
119  if (r.readValue("X", X) && r.readValue("Y", Y) && r.readValue("Z", Z))
120  pose.setRPY(X, Y, Z);
121 
122  update_req.setPose(id, pose);
123  }
124  else if(r.readValue("remove", remove) && remove == "true")
125  {
126  update_req.removePose(id);
127  }
128  else
129  {
130  res.response += "For entity '" + id + "': invalid pose (position).\n";
131  }
132 
133  r.endGroup();
134  }
135 
136  if (r.readArray("flags"))
137  {
138  while(r.nextArrayItem())
139  {
140  std::string flag;
141  if (r.readValue("add", flag))
142  update_req.setFlag(id, flag);
143  else if (r.readValue("remove", flag))
144  update_req.removeFlag(id, flag);
145  else
146  res.response += "For entity '" + id + "': flag list should only contain 'add' or 'remove'.\n";
147  }
148  }
149 
150  // Add data of entity, which is used for extra properties
151  // ToDo: should data be used in this way? Or should other variables be introduced for this purpose
152  std::string data_str;
153  if (r.readValue("data", data_str))
154  {
155  tue::Configuration data_config;
156  if (tue::config::loadFromYAMLString(data_str, data_config))
157  {
158  update_req.addData(id, data_config.data());
159  }
160  }
161 
162  if (r.readArray("properties"))
163  {
164  while(r.nextArrayItem())
165  {
166  std::string prop_name;
167  if (!r.readValue("name", prop_name))
168  continue;
169 
170  // ToDo: is this thread safe?
171  const ed::PropertyKeyDBEntry* entry = ed_wm->getPropertyKeyDBEntry(prop_name);
172  if (!entry)
173  {
174  res.response += "For entity '" + id + "': unknown property '" + prop_name +"'.\n";
175  continue;
176  }
177 
178  if (!entry->info->serializable())
179  {
180  res.response += "For entity '" + id + "': property '" + prop_name +"' is not serializable.\n";
181  continue;
182  }
183 
184  ed::Variant value;
185  if (entry->info->deserialize(r, value))
186  update_req.setProperty(id, entry, value);
187  else
188  res.response += "For entity '" + id + "': deserialization of property '" + prop_name +"' failed.\n";
189  }
190 
191  r.endArray();
192  }
193  }
194 
195  r.endArray();
196  }
197 
198  if (r.ok())
199  {
200  if (!update_req.empty())
201  {
202  ed_wm->update(update_req);
203  }
204  }
205  else
206  {
207  res.response += r.error();
208  }
209 
210  return true;
211 }
212 
213 // ----------------------------------------------------------------------------------------------------
214 
215 bool srvQuery(ed_msgs::Query::Request& req, ed_msgs::Query::Response& res)
216 {
217  // Set of queried ids
218  std::set<std::string> ids(req.ids.begin(), req.ids.end());
219 
220  // convert property names to indexes
221  std::vector<ed::Idx> property_idxs;
222  for(std::vector<std::string>::const_iterator it = req.properties.begin(); it != req.properties.end(); ++it)
223  {
224  // ToDo: is this thread safe?
226  if (entry)
227  property_idxs.push_back(entry->idx);
228  }
229 
230  // Make a copy of the WM, to keep it thead safe
232  const std::vector<unsigned long>& entity_revs = wm.entity_revisions();
233  const std::vector<ed::EntityConstPtr>& entities = wm.entities();
234 
235  std::vector<std::string> removed_entities;
236 
237  std::stringstream out;
238  ed::io::JSONWriter w(out);
239 
240  w.writeArray("entities");
241 
242  for(ed::Idx i = 0; i < entity_revs.size(); ++i)
243  {
244  if (req.since_revision >= entity_revs[i])
245  continue;
246 
247  const ed::EntityConstPtr& e = entities[i];
248  if (!e)
249  continue;
250 
251  if (!ids.empty() && ids.find(e->id().str()) == ids.end())
252  continue;
253 
254  if (e)
255  {
256  w.addArrayItem();
257  w.writeValue("id", e->id().str());
258  w.writeValue("idx", (int) i);
259 
260  // Write type
261  w.writeValue("type", e->type());
262 
263  w.writeValue("existence_prob", e->existenceProbability());
264 
265  w.writeGroup("timestamp");
266  {
267  ed::serializeTimestamp(e->lastUpdateTimestamp(), w);
268  w.endGroup();
269  }
270 
271  // Write convex hull
272  if (!e->convexHull().points.empty() && wm.entity_visual_revisions()[i] > req.since_revision)
273  {
274  w.writeGroup("convex_hull");
275  ed::serialize(e->convexHull(), w);
276  w.endGroup();
277  }
278 
279  // Pose
280  if (e->has_pose())
281  {
282  w.writeGroup("pose");
283  ed::serialize(e->pose(), w);
284  w.endGroup();
285  }
286 
287  // Mesh
288  if (e->visual() && wm.entity_visual_revisions()[i] > req.since_revision)
289  {
290  w.writeGroup("mesh");
291  ed::serialize(*e->visual(), w);
292  w.endGroup();
293  }
294 
295  // Data
296  if (!e->data().empty())
297  {
298  tue::config::YAMLEmitter emitter;
299  std::stringstream out;
300  emitter.emit(e->data(), out);
301 
302  std::string data_str = out.str();
303 
304  std::replace(data_str.begin(), data_str.end(), '"', '|');
305  std::replace(data_str.begin(), data_str.end(), '\n', '^');
306 
307  w.writeValue("data", data_str);
308  }
309 
310  w.writeArray("properties");
311 
312  const std::map<ed::Idx, ed::Property>& properties = e->properties();
313 
314  if (req.properties.empty())
315  {
316  for(std::map<ed::Idx, ed::Property>::const_iterator it = properties.begin(); it != properties.end(); ++it)
317  {
318  const ed::Property& prop = it->second;
319  if (req.since_revision < prop.revision && prop.entry->info->serializable())
320  {
321  w.addArrayItem();
322  w.writeValue("name", prop.entry->name);
323  prop.entry->info->serialize(prop.value, w);
324  w.endArrayItem();
325  }
326  }
327  }
328  else
329  {
330  for(std::vector<ed::Idx>::const_iterator it = property_idxs.begin(); it != property_idxs.end(); ++it)
331  {
332  std::map<ed::Idx, ed::Property>::const_iterator it_prop = properties.find(*it);
333  if (it_prop != properties.end())
334  {
335  const ed::Property& prop = it_prop->second;
336  if (req.since_revision < prop.revision && prop.entry->info->serializable())
337  {
338  w.addArrayItem();
339  w.writeValue("name", prop.entry->name);
340  prop.entry->info->serialize(prop.value, w);
341  w.endArrayItem();
342  }
343  }
344  }
345  }
346 
347  w.endArray();
348 
349  w.endArrayItem();
350  }
351  else
352  {
353  // Was removed
354  removed_entities.push_back(e->id().str());
355  }
356  }
357 
358  w.endArray();
359 
360  if (!removed_entities.empty())
361  w.writeValue("removed_entities", &removed_entities[0], removed_entities.size());
362 
363  w.finish();
364 
365  res.human_readable = out.str();
366  res.new_revision = wm.revision();
367 
368  return true;
369 }
370 
371 // ----------------------------------------------------------------------------------------------------
372 
373 bool srvSimpleQuery(ed_msgs::SimpleQuery::Request& req, ed_msgs::SimpleQuery::Response& res)
374 {
375  double radius = req.radius;
376  geo::Vector3 center_point;
377  geo::convert(req.center_point, center_point);
378 
379  // Make a copy of the WM, to keep it thead safe
381  for(ed::WorldModel::const_iterator it = wm.begin(); it != wm.end(); ++it)
382  {
383  const ed::EntityConstPtr& e = *it;
384  if (!req.id.empty() && e->id() != ed::UUID(req.id))
385  continue;
386 
387  if (!e->has_pose())
388  continue;
389 
390  if (!req.type.empty())
391  {
392  if (req.type == "unknown")
393  {
394  if (e->type() != "")
395  continue;
396  }
397  else
398  {
399  if (!e->hasType(req.type))
400  continue;
401  }
402  }
403 
405  {
406  bool geom_ok = false;
407 
408  if(req.ignore_z)
409  center_point.z = e->pose().t.z; // Ignoring z in global frame, not in entity frame, as it can be rotated
410 
411  geo::ShapeConstPtr visual = e->visual();
412  if (visual)
413  {
414  geo::Vector3 center_point_e = e->pose().getBasis().transpose() * (center_point - e->pose().getOrigin());
415  if (radius > 0)
416  geom_ok = visual->intersect(center_point_e, radius);
417  else
418  geom_ok = visual->contains(center_point_e);
419  }
420  else
421  {
422  geom_ok = radius > 0 && radius * radius > (e->pose().t - center_point).length2();
423  }
424 
425  if (!geom_ok)
426  continue;
427  }
428 
429  res.entities.push_back(ed_msgs::EntityInfo());
430  convert(*e, res.entities.back());
431 
432  }
433 
434  return true;
435 }
436 
437 // ----------------------------------------------------------------------------------------------------
438 
439 bool srvConfigure(ed_msgs::Configure::Request& req, ed_msgs::Configure::Response& res)
440 {
442  if (!tue::config::loadFromYAMLString(req.request, config))
443  {
444  res.error_msg = config.error();
445  return true;
446  }
447 
448  // Configure ED
450 
451  if (config.hasError())
452  {
453  res.error_msg = config.error();
454  return true;
455  }
456 
457  return true;
458 }
459 
460 // ----------------------------------------------------------------------------------------------------
461 
463 {
464  const char * val = ::getenv(var.c_str());
465  if ( val == nullptr )
466  return false;
467 
468  value = val;
469  return true;
470 }
471 
472 // ----------------------------------------------------------------------------------------------------
473 
474 void signalHandler( int sig )
475 {
476  // Make sure to remove all signal handlers
477  signal(SIGSEGV, SIG_DFL);
478  signal(SIGABRT, SIG_DFL);
479 
480  std::cerr << "\033[38;5;1m";
481  std::cerr << "[ED] ED Crashed!" << std::endl << std::endl;
482 
483  // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
484  // Print signal
485 
486  std::cerr << " Signal: ";
487  if (sig == SIGSEGV)
488  std::cerr << "segmentation fault";
489  else if (sig == SIGABRT)
490  std::cerr << "abort";
491  else
492  std::cerr << "unknown";
494 
495  // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
496  // Print thread name
497 
498  std::cerr << " Thread: ";
499 
500  char name[1000];
501  size_t name_size = 1000;
502  if (pthread_getname_np(pthread_self(), name, name_size) == 0)
503  {
504  if (std::string(name) == "ed_main")
505  {
506  if (boost::this_thread::get_id() == main_thread_id)
507  std::cerr << "main";
508  else
509  std::cerr << "name unknown (id = " << boost::this_thread::get_id() << ")";
510  }
511  else
512  std::cerr << name;
513  }
514  else
515  std::cerr << "name unknown (id = " << boost::this_thread::get_id() << ")";
516 
518 
519  // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
520  // Print error context
521 
522  std::cerr << " Error context: ";
523 
525  if (edata && !edata->stack.empty())
526  {
528 
529  for(unsigned int i = edata->stack.size(); i > 0; --i)
530  {
531  const char* message = edata->stack[i-1].first;
532  const char* value = edata->stack[i-1].second;
533 
534  if (message)
535  {
536  std::cerr << " " << message;
537  if (value)
538  std::cerr << " " << value;
539  std::cerr << std::endl;
540  }
541  }
542  }
543  else
544  std::cerr << "unknown";
545 
547 
548  // - - - - - - - - - - - - - - - - - - - - - - - - - - - -
549  // Print backtrace
550 
551  std::cerr << "--------------------------------------------------" << std::endl;
552  std::cerr << "Backtrace: " << std::endl << std::endl;
553 
554  void *array[20];
555  size_t size;
556 
557  // get void*'s for all entries on the stack
558  size = backtrace(array, 20);
559 
560  // print out all the frames to stderr
561  backtrace_symbols_fd(array, size, STDERR_FILENO);
562  std::cerr << "\033[0m" << std::endl;
563  exit(1);
564 }
565 
566 // ----------------------------------------------------------------------------------------------------
567 
568 int main(int argc, char** argv)
569 {
570  ros::init(argc, argv, "ed");
571 
572  // Set the name of the main thread
573  pthread_setname_np(pthread_self(), "ed_main");
574 
575  // Remember the main thread id
576  main_thread_id = boost::this_thread::get_id();
577 
578  // register signal SIGINT and signal handler
579  signal(SIGSEGV, signalHandler);
580  signal(SIGABRT, signalHandler);
581 
582  ed::ErrorContext errc("Start ED server", "init");
583 
584  // Create the ED server
585  ed::Server server;
586  ed_wm = &server;
587 
588  // - - - - - - - - - - - - - - - configure - - - - - - - - - - - - - - -
589 
590  errc.change("Start ED server", "configure");
591 
593 
594  // Check if a config file was provided. If so, load it. If not, load the default AMIGO config.
595  if (argc >= 2)
596  {
597  std::string yaml_filename = argv[1];
598  config.loadFromYAMLFile(yaml_filename);
599 
600  // Configure ED
602 
603  if (config.hasError())
604  {
605  ROS_ERROR_STREAM(std::endl << "Error during configuration:" << std::endl << std::endl << config.error());
606  return 1;
607  }
608  }
609 
610  // - - - - - - - - - - - - service initialization - - - - - - - - - - - -
611 
612  errc.change("Start ED server", "service init");
613 
614  ros::NodeHandle nh;
615  ros::NodeHandle nh_private("~");
616 
617  ros::CallbackQueue cb_queue;
618 
619  ros::AdvertiseServiceOptions opt_simple_query =
620  ros::AdvertiseServiceOptions::create<ed_msgs::SimpleQuery>(
621  "simple_query", srvSimpleQuery, ros::VoidPtr(), &cb_queue);
622  ros::ServiceServer srv_simple_query = nh_private.advertiseService(opt_simple_query);
623 
624  ros::AdvertiseServiceOptions opt_reset =
625  ros::AdvertiseServiceOptions::create<ed_msgs::Reset>(
626  "reset", srvReset, ros::VoidPtr(), &cb_queue);
627  ros::ServiceServer srv_reset = nh_private.advertiseService(opt_reset);
628 
629  ros::NodeHandle nh_private2("~");
630  nh_private2.setCallbackQueue(&cb_queue);
631 
632  ros::ServiceServer srv_query = nh_private2.advertiseService("query", srvQuery);
633  ros::ServiceServer srv_update = nh_private2.advertiseService("update", srvUpdate);
634  ros::ServiceServer srv_configure = nh_private2.advertiseService("configure", srvConfigure);
635 
636  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
637 
638  errc.change("Start ED server", "init");
639 
640  // Init ED
641  ed_wm->initialize();
642 
643  ed::EventClock trigger_config(10);
644  ed::EventClock trigger_ed(10);
645  ed::EventClock trigger_stats(2);
646  ed::EventClock trigger_plugins(1000);
647  ed::EventClock trigger_cb(100);
648 
649  // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
650 
651  errc.change("ED server", "main loop");
652 
653  ros::Rate r(1000);
654  while(ros::ok()) {
655 
656  if (trigger_cb.triggers())
657  cb_queue.callAvailable();
658 
659  // Check if configuration has changed. If so, call reconfigure
660  if (trigger_config.triggers() && config.sync())
661  ed_wm->configure(config, true);
662 
663  if (trigger_ed.triggers())
664  ed_wm->update();
665 
666  if (trigger_plugins.triggers())
667  ed_wm->stepPlugins();
668 
669  if (trigger_stats.triggers())
671 
672  r.sleep();
673  }
674 
675  return 0;
676 }
geo::Vector3
Vec3 Vector3
datatypes.h
ed_wm
ed::Server * ed_wm
Definition: ed.cpp:58
ed::WorldModel
Definition: world_model.h:21
ed::io::JSONWriter::writeArray
void writeArray(const std::string &key)
Definition: json_writer.h:131
ed::io::JSONWriter::endArrayItem
void endArrayItem()
Definition: json_writer.h:150
srvConfigure
bool srvConfigure(ed_msgs::Configure::Request &req, ed_msgs::Configure::Response &res)
Definition: ed.cpp:439
ed::UpdateRequest
Definition: update_request.h:24
std::string
ed::Server::stepPlugins
void stepPlugins()
Definition: server.cpp:240
std::shared_ptr
ed::io::JSONWriter::writeValue
void writeValue(const std::string &key, float f)
Definition: json_writer.h:47
ed::UpdateRequest::addData
void addData(const UUID &id, const tue::config::DataConstPointer &data)
Definition: update_request.h:148
entity.h
ed::Server::reset
void reset(bool keep_all_shapes=false)
Definition: server.cpp:153
geo::Transform3T::identity
static Transform3T identity()
ed::io::JSONReader
Definition: json_reader.h:16
std::vector
std::set::find
T find(T... args)
std::vector::size
T size(T... args)
ed::ErrorContextData
Definition: error_context.h:9
srvSimpleQuery
bool srvSimpleQuery(ed_msgs::SimpleQuery::Request &req, ed_msgs::SimpleQuery::Response &res)
Definition: ed.cpp:373
tue::config::YAMLEmitter
srvUpdate
bool srvUpdate(ed_msgs::UpdateSrv::Request &req, ed_msgs::UpdateSrv::Response &res)
Definition: ed.cpp:71
ed::ErrorContext::data
static ErrorContextData * data()
Definition: error_context.cpp:65
main
int main(int argc, char **argv)
Definition: ed.cpp:568
std::stringstream
ed::io::JSONReader::nextArrayItem
bool nextArrayItem()
Definition: json_reader.cpp:185
ed::io::JSONReader::readValue
bool readValue(const std::string &, float &f)
Definition: json_reader.cpp:214
srvReset
bool srvReset(ed_msgs::Reset::Request &req, ed_msgs::Reset::Response &)
Definition: ed.cpp:63
plugin.h
srvQuery
bool srvQuery(ed_msgs::Query::Request &req, ed_msgs::Query::Response &res)
Definition: ed.cpp:215
ed::PropertyInfo::deserialize
virtual bool deserialize(io::Reader &, Variant &) const
Definition: property_info.h:23
std::cerr
ed::Property::entry
const PropertyKeyDBEntry * entry
Definition: property.h:17
ed::io::JSONReader::readArray
bool readArray(const std::string &name)
Definition: json_reader.cpp:150
ed::io::JSONWriter::writeGroup
void writeGroup(const std::string &name)
Definition: json_writer.h:27
ed::Server::getPropertyKeyDBEntry
const PropertyKeyDBEntry * getPropertyKeyDBEntry(const std::string &name) const
Definition: server.h:65
geo::Transform3T
tue::config::ReaderWriter::loadFromYAMLFile
bool loadFromYAMLFile(const std::string &filename, const ResolveConfig &resolve_config=ResolveConfig::defaultConfig())
ed::UpdateRequest::removeEntity
void removeEntity(const UUID &id)
Definition: update_request.h:194
ed::io::JSONReader::readGroup
bool readGroup(const std::string &name)
Definition: json_reader.cpp:128
ed::ErrorContext
Definition: error_context.h:14
ed::WorldModel::begin
const_iterator begin() const
Definition: world_model.h:68
update_request_
std::string update_request_
Definition: ed.cpp:59
ed::EntityConstPtr
shared_ptr< const Entity > EntityConstPtr
Definition: types.h:37
ed::EventClock::triggers
bool triggers()
Definition: event_clock.h:17
ed::WorldModel::end
const_iterator end() const
Definition: world_model.h:70
std::replace
T replace(T... args)
tue::config::loadFromYAMLString
bool loadFromYAMLString(const std::string &string, ReaderWriter &config, const ResolveConfig &resolve_config=ResolveConfig::defaultConfig())
std::vector::push_back
T push_back(T... args)
tue::config::ReaderWriter
ed::Property::value
Variant value
Definition: property.h:16
ed::Server::configure
void configure(tue::Configuration &config, bool reconfigure=false)
Definition: server.cpp:49
ed::PropertyKeyDBEntry::idx
Idx idx
Definition: property_key_db.h:25
tue::config::ReaderWriter::sync
bool sync()
ed::UpdateRequest::removePose
void removePose(const UUID &id)
Definition: update_request.h:135
update_request.h
ed::ErrorContextData::stack
std::vector< std::pair< const char *, const char * > > stack
Definition: error_context.h:11
ed::EventClock
Definition: event_clock.h:9
tue::config::ReaderWriter::data
DataPointer data() const
ed::UpdateRequest::setFlag
void setFlag(const UUID &id, const std::string &flag)
Definition: update_request.h:201
ed::io::JSONWriter::endArray
void endArray()
Definition: json_writer.h:160
measurement.h
tue::config::ReaderWriter::error
const std::string & error() const
json_reader.h
std::string::c_str
T c_str(T... args)
event_clock.h
ed::WorldModel::entity_revisions
const std::vector< unsigned long > & entity_revisions() const
Definition: world_model.h:103
ed::UpdateRequest::setPose
void setPose(const UUID &id, const geo::Pose3D &pose)
Definition: update_request.h:132
ed::io::JSONWriter::endGroup
void endGroup()
Definition: json_writer.h:37
ed::io::JSONReader::ok
bool ok()
Definition: json_reader.h:38
signalHandler
void signalHandler(int sig)
Definition: ed.cpp:474
geo::Transform3T::t
Vec3T< T > t
ed::Variant
Definition: variant.h:49
ed::PropertyKeyDBEntry
Definition: property_key_db.h:13
ed::convert
void convert(const geo::ShapeConstPtr shape, ed_msgs::SubVolume &sub_Volume)
converting geo::ShapeConstPtr to ed_msgs::SubVolume message
Definition: msg_conversions.h:26
ed::UUID
Definition: uuid.h:10
ed::io::JSONReader::error
std::string error()
Definition: json_reader.h:40
getEnvironmentVariable
bool getEnvironmentVariable(const std::string &var, std::string &value)
Definition: ed.cpp:462
geo::Vector3
yaml_emitter.h
std::map
yaml.h
ed::Server::world_model
WorldModelConstPtr world_model() const
Definition: server.h:53
ed::WorldModel::EntityIterator
Definition: world_model.h:26
geo::Vector3::z
const real & z() const
json_writer.h
ed::Server::update
void update()
Definition: server.cpp:289
ed::Server::publishStatistics
void publishStatistics()
Definition: server.cpp:457
geo::convert
void convert(const geo::DepthCamera &cam_model, sensor_msgs::CameraInfo &msg)
ed::UpdateRequest::setType
void setType(const UUID &id, const std::string &type)
Definition: update_request.h:106
ed::PropertyInfo::serialize
virtual void serialize(const Variant &, io::Writer &) const
Definition: property_info.h:21
ed::io::JSONReader::endArray
bool endArray()
Definition: json_reader.cpp:165
ed::io::JSONWriter::finish
void finish()
Definition: json_writer.h:170
ed::io::JSONReader::endGroup
bool endGroup()
Definition: json_reader.cpp:141
std::endl
T endl(T... args)
tue::config::YAMLEmitter::emit
void emit(const tue::config::DataConstPointer &cfg, std::ostream &out, const std::string &indent="")
std::vector::begin
T begin(T... args)
ed::io::JSONWriter
Definition: json_writer.h:15
ed::Server::initialize
void initialize()
Definition: server.cpp:142
ed::UpdateRequest::removeFlag
void removeFlag(const UUID &id, const std::string &flag)
Definition: update_request.h:205
ed::WorldModel::entities
const std::vector< EntityConstPtr > & entities() const
Warning: the return vector may return null-pointers.
Definition: world_model.h:96
ed::PropertyKeyDBEntry::name
std::string name
Definition: property_key_db.h:23
error_context.h
ed::PropertyKeyDBEntry::info
PropertyInfo * info
Definition: property_key_db.h:24
ed::UpdateRequest::empty
bool empty() const
Definition: update_request.h:213
std::set::empty
T empty(T... args)
serialization.h
std::stringstream::str
T str(T... args)
ed::UpdateRequest::setProperty
void setProperty(const UUID &id, const PropertyKey< T > &key, const T &value)
Definition: update_request.h:170
ed::PropertyInfo::serializable
virtual bool serializable() const
Definition: property_info.h:25
std::set::end
T end(T... args)
msg_conversions.h
ed::serialize
void serialize(const geo::Pose3D &pose, ed::io::Writer &w)
Definition: serialization.cpp:150
server.h
ed::Property::revision
unsigned long revision
Definition: property.h:18
main_thread_id
boost::thread::id main_thread_id
Definition: ed.cpp:56
ed::WorldModel::entity_visual_revisions
const std::vector< unsigned long > & entity_visual_revisions() const
Definition: world_model.h:108
ed::WorldModel::revision
unsigned long revision() const
Definition: world_model.h:101
ed::Server
Definition: server.h:32
std::numeric_limits
set
ed::Idx
uint64_t Idx
Definition: types.h:21
ed::ErrorContext::change
void change(const char *msg, const char *value=0)
Definition: error_context.cpp:59
geo::Transform3T::setRPY
void setRPY(double roll, double pitch, double yaw)
ed::io::JSONWriter::addArrayItem
void addArrayItem()
Definition: json_writer.h:141
msg_conversions.h
ed::serializeTimestamp
void serializeTimestamp(double time, ed::io::Writer &w)
Definition: serialization.cpp:457
ed::Property
Definition: property.h:12
config
tue::config::ReaderWriter config
world_model.h
tue::config::ReaderWriter::hasError
bool hasError() const