Skip to content

Commit 0b342b5

Browse files
committed
Add more error_context
1 parent 74a6a54 commit 0b342b5

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

ed_sensor_integration/src/kinect/kinect_plugin.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
#include <ros/node_handle.h>
66

7-
#include <ed/uuid.h>
8-
#include <ed/world_model.h>
97
#include <ed/entity.h>
8+
#include <ed/error_context.h>
109
#include <ed/update_request.h>
10+
#include <ed/uuid.h>
11+
#include <ed/world_model.h>
1112

1213
#include <tue/config/reader.h>
1314

@@ -31,18 +32,21 @@
3132

3233
KinectPlugin::KinectPlugin()
3334
{
35+
ed::ErrorContext errc("RGBDPlugin", "constructor");
3436
}
3537

3638
// ----------------------------------------------------------------------------------------------------
3739

3840
KinectPlugin::~KinectPlugin()
3941
{
42+
ed::ErrorContext errc("RGBDPlugin", "destructor");
4043
}
4144

4245
// ----------------------------------------------------------------------------------------------------
4346

4447
void KinectPlugin::initialize(ed::InitData& init)
4548
{
49+
ed::ErrorContext errc("RGBDPlugin", "initialize");
4650
tue::Configuration& config = init.config;
4751

4852
std::string topic;
@@ -69,6 +73,7 @@ void KinectPlugin::initialize(ed::InitData& init)
6973

7074
void KinectPlugin::process(const ed::PluginInput& data, ed::UpdateRequest& req)
7175
{
76+
ed::ErrorContext errc("RGBDPlugin", "process");
7277
// - - - - - - - - - - - - - - - - - -
7378
// Fetch kinect image and pose
7479

@@ -94,6 +99,7 @@ void KinectPlugin::process(const ed::PluginInput& data, ed::UpdateRequest& req)
9499

95100
bool KinectPlugin::srvGetImage(ed_sensor_integration_msgs::GetImage::Request& req, ed_sensor_integration_msgs::GetImage::Response& res)
96101
{
102+
ed::ErrorContext errc("RGBDPlugin", "srvGetImage");
97103
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
98104
// Get new image
99105

@@ -147,6 +153,7 @@ bool KinectPlugin::srvGetImage(ed_sensor_integration_msgs::GetImage::Request& re
147153

148154
bool KinectPlugin::srvUpdate(ed_sensor_integration_msgs::Update::Request& req, ed_sensor_integration_msgs::Update::Response& res)
149155
{
156+
ed::ErrorContext errc("RGBDPlugin", "srvUpdate");
150157
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
151158
// Get new image
152159

@@ -203,6 +210,7 @@ bool KinectPlugin::srvUpdate(ed_sensor_integration_msgs::Update::Request& req, e
203210

204211
bool KinectPlugin::srvRayTrace(ed_sensor_integration_msgs::RayTrace::Request& req, ed_sensor_integration_msgs::RayTrace::Response& res)
205212
{
213+
ed::ErrorContext errc("RGBDPlugin", "srvRayTrace");
206214
if (req.raytrace_pose.header.frame_id != "/map" && req.raytrace_pose.header.frame_id != "map")
207215
{
208216
ROS_ERROR("KinectPlugin::srvRayTrace only works with poses expressed in map frame");

ed_sensor_integration/src/kinect/ray_tracer.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#include "ray_tracer.h"
22

3-
#include <ed/world_model.h>
43
#include <ed/entity.h>
4+
#include <ed/error_context.h>
5+
#include <ed/world_model.h>
56

67
#include <geolib/Shape.h>
78

@@ -47,6 +48,7 @@ class PointRenderResult : public geo::LaserRangeFinder::RenderResult
4748

4849
RayTraceResult ray_trace(const ed::WorldModel& world, const geo::Pose3D& raytrace_pose)
4950
{
51+
ed::ErrorContext errc("ray_trace");
5052
PointRenderResult res;
5153

5254
geo::LaserRangeFinder lrf;

0 commit comments

Comments
 (0)