Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
5 #include <ros/node_handle.h>
55 ROS_INFO_STREAM(
"[ED KINECT PLUGIN] Initializing kinect client with topic '" << topic <<
"'.");
62 ros::NodeHandle nh(
"~");
111 res.error_msg =
"Could not get image";
144 res.json_meta_data = meta_data.
str();
146 ROS_INFO_STREAM(
"[ED KINECT] Requested image. Image size: " << res.rgbd_data.size()
147 <<
" bytes. Meta-data size: " << res.json_meta_data.size() <<
" bytes.");
154 bool KinectPlugin::srvUpdate(ed_sensor_integration_msgs::Update::Request& req, ed_sensor_integration_msgs::Update::Response& res)
165 res.error_msg =
"Could not get image";
184 res.error_msg = kinect_update_res.
error.
str();
197 res.updated_ids.push_back(e_update.
id.
str());
214 if (
req.raytrace_pose.header.frame_id !=
"/map" &&
req.raytrace_pose.header.frame_id !=
"map")
216 ROS_ERROR(
"KinectPlugin::srvRayTrace only works with poses expressed in map frame");
227 ROS_ERROR(
"ed_ray_tracer::RayTrace failed!");
233 res.intersection_point.header.stamp = ros::Time::now();
234 res.intersection_point.header.frame_id =
"map";
236 visualization_msgs::Marker marker_msg;
237 marker_msg.header.frame_id =
"map";
238 marker_msg.header.stamp = ros::Time::now();
239 marker_msg.action = visualization_msgs::Marker::ADD;
240 marker_msg.color.a = 0.5;
241 marker_msg.lifetime = ros::Duration(10.0);
242 marker_msg.scale.x = 0.05;
247 marker_msg.color.b = marker_msg.color.r = 1;
251 marker_msg.color.b = marker_msg.color.g = 1;
254 marker_msg.type = visualization_msgs::Marker::LINE_STRIP;
256 marker_msg.points.push_back(
req.raytrace_pose.pose.position);
257 marker_msg.points.push_back(res.intersection_point.point);
259 marker_msg.color.a = marker_msg.color.r = marker_msg.color.g = marker_msg.color.b = 1;
260 marker_msg.scale.x = 0.02;
268 if (e->hasFlag(
"highlighted"))
276 ROS_INFO(
"Hit on %s", res.entity_id.c_str());
278 ROS_INFO(
"Setting %s to highlighted", res.entity_id.c_str());
ed::UpdateRequest * update_req_
EntityConstPtr getEntity(const ed::UUID &id) const
ros::ServiceServer srv_ray_trace_
void writeValue(const std::string &key, const float *fs, std::size_t size)
collection structure for laser entities
#define ED_REGISTER_PLUGIN(Derived)
bool srvUpdate(ed_sensor_integration_msgs::Update::Request &req, ed_sensor_integration_msgs::Update::Response &res)
void writeGroup(const std::string &name)
tue::Configuration & config
const_iterator begin() const
double background_padding
EntityIterator const_iterator
RayTraceResult ray_trace(const ed::WorldModel &world, const geo::Pose3D &raytrace_pose)
geo::Vector3 intersection_point_
shared_ptr< const Entity > EntityConstPtr
const_iterator end() const
std::vector< EntityUpdate > entity_updates
void convert(Archive &a, std::vector< unsigned char > &data)
ros::Publisher ray_trace_visualization_publisher_
bool serialize(const Image &image, tue::serialization::OutputArchive &a, RGBStorageType rgb_type=RGB_STORAGE_JPG, DepthStorageType depth_type=DEPTH_STORAGE_PNG)
const ed::WorldModel * world_
void setFlag(const UUID &id, const std::string &flag)
void serialize(const ConvexHull &ch, ed::io::Writer &w)
std::string area_description
bool srvRayTrace(ed_sensor_integration_msgs::RayTrace::Request &req, ed_sensor_integration_msgs::RayTrace::Response &res)
void convert(const geo::DepthCamera &cam_model, sensor_msgs::CameraInfo &msg)
ros::ServiceServer srv_get_image_
ros::CallbackQueue cb_queue_
std::vector< ed::UUID > removed_entity_ids
bool value(const std::string &name, T &value, RequiredOrOptional opt=REQUIRED)
bool update(const ed::WorldModel &world, const rgbd::ImageConstPtr &image, const geo::Pose3D &sensor_pose, const UpdateRequest &req, UpdateResult &res)
bool fit_supporting_entity
ros::ServiceServer srv_update_
void removeFlag(const UUID &id, const std::string &flag)
bool waitForRecentImage(rgbd::ImageConstPtr &image, geo::Pose3D &sensor_pose, double timeout_sec, double check_rate)
void initialize(const std::string &topic, const std::string &root_frame="map", const float worker_thread_frequency=20)
rgbd::ImageBuffer image_buffer_
virtual void initialize()
void process(const ed::PluginInput &data, ed::UpdateRequest &req)
const std::string & str() const
bool srvGetImage(ed_sensor_integration_msgs::GetImage::Request &req, ed_sensor_integration_msgs::GetImage::Response &res)
void serializeTimestamp(double time, ed::io::Writer &w)
tue::config::ReaderWriter config