Skip to content

Commit

Permalink
Remove hardcoding of API ports, add ID to config name
Browse files Browse the repository at this point in the history
  • Loading branch information
Sai Vemprala authored and sytelus committed Jan 19, 2018
1 parent e1d86e6 commit 2d9c52c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ void ASimModeWorldMultiRotor::setupVehiclesAndCamera(std::vector<VehiclePtr>& ve
pawns.Add(spawned_pawn);
}

unsigned int vehicle_id = 0;

//set up vehicle pawns
for (AActor* pawn : pawns)
{
Expand All @@ -127,6 +129,7 @@ void ASimModeWorldMultiRotor::setupVehiclesAndCamera(std::vector<VehiclePtr>& ve

//chose first pawn as FPV if none is designated as FPV
VehiclePawnWrapper* wrapper = vehicle_pawn->getVehiclePawnWrapper();

if (getSettings().enable_collision_passthrough)
wrapper->getConfig().enable_passthrough_on_collisions = true;
if (wrapper->getConfig().is_fpv_vehicle || fpv_vehicle_pawn_wrapper_ == nullptr)
Expand All @@ -137,6 +140,7 @@ void ASimModeWorldMultiRotor::setupVehiclesAndCamera(std::vector<VehiclePtr>& ve
if (vehicle != nullptr) {
vehicles.push_back(vehicle);
fpv_vehicle_connector_.Add(vehicle);
vehicle_id++;
}
//else we don't have vehicle for this pawn
}
Expand Down Expand Up @@ -198,7 +202,7 @@ ASimModeWorldBase::VehiclePtr ASimModeWorldMultiRotor::createVehicle(VehiclePawn
std::shared_ptr<MultiRotorConnector> vehicle = std::make_shared<MultiRotorConnector>(

wrapper, vehicle_params_.back().get(), getSettings().enable_rpc, getSettings().api_server_address,
vehicle_params_.back()->getParams().api_server_port + vehicle_params_.size() - 1, manual_pose_controller);
vehicle_params_.back()->getParams().api_server_port + vehicle_params_.size() - 1, manual_pose_controller);

if (vehicle->getPhysicsBody() != nullptr)
wrapper->setKinematics(&(static_cast<PhysicsBody*>(vehicle->getPhysicsBody())->getKinematics()));
Expand Down

0 comments on commit 2d9c52c

Please sign in to comment.