From 7202164910e6bde4d59b6bd1af8b33cd627114bc Mon Sep 17 00:00:00 2001 From: YoheiKakiuchi Date: Sat, 15 Feb 2014 12:52:56 +0900 Subject: [PATCH] add SensorBase class as base class for sensors (#3) --- urdf_model/include/urdf_model/model.h | 1 - urdf_sensor/include/urdf_sensor/sensor.h | 15 +++++++++++---- urdf_sensor/include/urdf_sensor/types.h | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/urdf_model/include/urdf_model/model.h b/urdf_model/include/urdf_model/model.h index 8b7ced8..a59f42f 100644 --- a/urdf_model/include/urdf_model/model.h +++ b/urdf_model/include/urdf_model/model.h @@ -198,7 +198,6 @@ class ModelInterface LinkSharedPtr root_link_; - }; } diff --git a/urdf_sensor/include/urdf_sensor/sensor.h b/urdf_sensor/include/urdf_sensor/sensor.h index 60126aa..dc25c06 100644 --- a/urdf_sensor/include/urdf_sensor/sensor.h +++ b/urdf_sensor/include/urdf_sensor/sensor.h @@ -72,10 +72,18 @@ namespace urdf{ -class VisualSensor +class SensorBase { +public: + enum {VISUAL, FORCE, TACTILE, IMU, GYRO, ACCELERATION, GPS} sensor_type; + virtual ~SensorBase(void) + { + } +}; + +class VisualSensor : public SensorBase { public: - enum {CAMERA, RAY} type; + enum {CAMERA, RAY, DEPTH} type; virtual ~VisualSensor(void) { } @@ -148,8 +156,7 @@ class Sensor Pose origin; /// sensor - VisualSensorSharedPtr sensor; - + SensorBaseSharedPtr sensor; /// Parent link element name. A pointer is stored in parent_link_. std::string parent_link_name; diff --git a/urdf_sensor/include/urdf_sensor/types.h b/urdf_sensor/include/urdf_sensor/types.h index 62de9e4..df00f79 100644 --- a/urdf_sensor/include/urdf_sensor/types.h +++ b/urdf_sensor/include/urdf_sensor/types.h @@ -42,10 +42,10 @@ namespace urdf{ -class VisualSensor; +class SensorBase; // typedef shared pointers -typedef boost::shared_ptr VisualSensorSharedPtr; +typedef boost::shared_ptr SensorBaseSharedPtr; }