-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the symbols if they are already loaded #304
Changes from 6 commits
7338e3a
db5dde6
d65936a
075b66a
5f85b01
e423cf7
3f42c00
ec01e9a
21722ed
d2de367
2f674e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,8 +134,8 @@ void AirPressurePrivate::CreateAirPressureEntities(EntityComponentManager &_ecm) | |
data.SetTopic(topic); | ||
} | ||
std::unique_ptr<sensors::AirPressureSensor> sensor = | ||
this->sensorFactory.CreateSensor< | ||
sensors::AirPressureSensor>(data); | ||
std::make_unique<sensors::AirPressureSensor>(); | ||
sensor->Load(data); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looking at the CreateSensor function, it also makes a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added init() method 3f42c00 |
||
// set sensor parent | ||
std::string parentName = _ecm.Component<components::Name>( | ||
_parent->Data())->Data(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -473,7 +473,26 @@ std::string Sensors::CreateSensor(const Entity &_entity, | |
} | ||
|
||
// Create within ign-sensors | ||
auto sensorId = this->dataPtr->sensorManager.CreateSensor(_sdf); | ||
ignition::sensors::SensorId sensorId; | ||
if (_sdf.Type() == sdf::SensorType::CAMERA) | ||
{ | ||
std::unique_ptr<sensors::CameraSensor> cameraSensor = | ||
std::make_unique<sensors::CameraSensor>(); | ||
cameraSensor->Load(_sdf); | ||
sensorId = this->dataPtr->sensorManager.AddSensor(std::move(cameraSensor)); | ||
} | ||
else if (_sdf.Type() == sdf::SensorType::THERMAL_CAMERA) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you also need to do the same for depth and rgbd camera? or do they work with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. depth and rgbd camera classes are not being used, we don't need to link against them, we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can try There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is now targeting Edifice, I think lines 485 - 504 can be replaced with:
At least, this worked for me. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I took the liberty of applying this change in 2f674e6. Feel free to revert. |
||
{ | ||
std::unique_ptr<sensors::ThermalCameraSensor> thermalCameraSensor = | ||
std::make_unique<sensors::ThermalCameraSensor>(); | ||
thermalCameraSensor->Load(_sdf); | ||
sensorId = this->dataPtr->sensorManager.AddSensor( | ||
std::move(thermalCameraSensor)); | ||
} | ||
else | ||
{ | ||
sensorId = this->dataPtr->sensorManager.CreateSensor(_sdf); | ||
} | ||
auto sensor = this->dataPtr->sensorManager.Sensor(sensorId); | ||
|
||
// Add to sensorID -> entity map | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied this change in 2f674e6