Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Feb 13, 2018
1 parent 1c07c9b commit a113686
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace msr { namespace airlib {

class MultiRotorParamsFactory {
public:
static std::unique_ptr<MultiRotorParams> createConfig(const std::string& vehicle_name, const SensorFactory* sensor_factory)
static std::unique_ptr<MultiRotorParams> createConfig(const std::string& vehicle_name, std::shared_ptr<const SensorFactory> sensor_factory)
{
AirSimSettings::VehicleSettings vehicle_settings =
AirSimSettings::singleton().getVehicleSettings(vehicle_name);
Expand Down
4 changes: 2 additions & 2 deletions AirLib/include/vehicles/multirotor/configs/Px4MultiRotor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace msr { namespace airlib {

class Px4MultiRotor : public MultiRotorParams {
public:
Px4MultiRotor(const AirSimSettings::VehicleSettings& vehicle_settings, const SensorFactory* sensor_factory)
Px4MultiRotor(const AirSimSettings::VehicleSettings& vehicle_settings, std::shared_ptr<const SensorFactory> sensor_factory)
: sensor_factory_(sensor_factory)
{
connection_info_ = getConnectionInfo(vehicle_settings);
Expand Down Expand Up @@ -287,7 +287,7 @@ class Px4MultiRotor : public MultiRotorParams {

private:
MavLinkDroneController::ConnectionInfo connection_info_;
const SensorFactory* sensor_factory_;
std::shared_ptr<const SensorFactory> sensor_factory_;

};

Expand Down
4 changes: 2 additions & 2 deletions AirLib/include/vehicles/multirotor/configs/RosFlightQuadX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace msr { namespace airlib {

class RosFlightQuadX : public MultiRotorParams {
public:
RosFlightQuadX(const AirSimSettings::VehicleSettings& vehicle_settings, const SensorFactory* sensor_factory)
RosFlightQuadX(const AirSimSettings::VehicleSettings& vehicle_settings, std::shared_ptr<const SensorFactory> sensor_factory)
: sensor_factory_(sensor_factory)
{
unused(vehicle_settings);
Expand Down Expand Up @@ -73,7 +73,7 @@ class RosFlightQuadX : public MultiRotorParams {

private:
vector<unique_ptr<SensorBase>> sensor_storage_;
const SensorFactory* sensor_factory_;
std::shared_ptr<const SensorFactory> sensor_factory_;

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace msr { namespace airlib {

class SimpleFlightQuadX : public MultiRotorParams {
public:
SimpleFlightQuadX(const AirSimSettings::VehicleSettings& vehicle_settings, const SensorFactory* sensor_factory)
SimpleFlightQuadX(const AirSimSettings::VehicleSettings& vehicle_settings, std::shared_ptr<const SensorFactory> sensor_factory)
: vehicle_settings_(vehicle_settings), sensor_factory_(sensor_factory)
{
}
Expand Down Expand Up @@ -69,7 +69,7 @@ class SimpleFlightQuadX : public MultiRotorParams {
private:
vector<unique_ptr<SensorBase>> sensor_storage_;
AirSimSettings::VehicleSettings vehicle_settings_;
const SensorFactory* sensor_factory_;
std::shared_ptr<const SensorFactory> sensor_factory_;
};

}} //namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ void ASimModeWorldMultiRotor::createVehicles(std::vector<VehiclePtr>& vehicles)

ASimModeWorldBase::VehiclePtr ASimModeWorldMultiRotor::createVehicle(VehiclePawnWrapper* wrapper)
{
UnrealSensorFactory sensor_factory(wrapper->getPawn());
auto vehicle_params = MultiRotorParamsFactory::createConfig(wrapper->getVehicleConfigName(), & sensor_factory);
std::shared_ptr<UnrealSensorFactory> sensor_factory = std::make_shared<UnrealSensorFactory>(wrapper->getPawn());
auto vehicle_params = MultiRotorParamsFactory::createConfig(wrapper->getVehicleConfigName(), sensor_factory);

vehicle_params_.push_back(std::move(vehicle_params));

Expand Down

0 comments on commit a113686

Please sign in to comment.