Skip to content

Commit

Permalink
add SensorBase class as base class for sensors (ros#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoheiKakiuchi authored and rhaschke committed Sep 7, 2018
1 parent e7e0972 commit 635f582
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
1 change: 0 additions & 1 deletion urdf_model/include/urdf_model/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ class ModelInterface
LinkSharedPtr root_link_;



};

}
Expand Down
15 changes: 11 additions & 4 deletions urdf_sensor/include/urdf_sensor/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions urdf_sensor/include/urdf_sensor/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@

namespace urdf{

class VisualSensor;
class SensorBase;

// typedef shared pointers
typedef std::shared_ptr<VisualSensor> VisualSensorSharedPtr;
typedef std::shared_ptr<SensorBase> SensorBaseSharedPtr;

}

Expand Down

0 comments on commit 635f582

Please sign in to comment.