Skip to content

Commit c10cfdc

Browse files
author
Matthew Brown
committed
untabified everything
1 parent e27ddca commit c10cfdc

File tree

7 files changed

+63
-63
lines changed

7 files changed

+63
-63
lines changed

AirLib/include/api/RpcLibClientBase.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ class RpcLibClientBase {
7575
msr::airlib::GpsBase::Output getGpsData(const std::string& gps_name = "", const std::string& vehicle_name = "") const;
7676
msr::airlib::DistanceBase::Output getDistanceSensorData(const std::string& distance_sensor_name = "", const std::string& vehicle_name = "") const;
7777

78-
// sensor omniscient APIs
79-
vector<int> simGetLidarSegmentation(const std::string& lidar_name = "", const std::string& vehicle_name = "") const;
78+
// sensor omniscient APIs
79+
vector<int> simGetLidarSegmentation(const std::string& lidar_name = "", const std::string& vehicle_name = "") const;
8080

8181
Pose simGetVehiclePose(const std::string& vehicle_name = "") const;
8282
void simSetVehiclePose(const Pose& pose, bool ignore_collision, const std::string& vehicle_name = "");

AirLib/include/api/VehicleApiBase.hpp

+28-28
Original file line numberDiff line numberDiff line change
@@ -110,21 +110,21 @@ class VehicleApiBase : public UpdatableObject {
110110
// Lidar APIs
111111
virtual LidarData getLidarData(const std::string& lidar_name) const
112112
{
113-
auto *lidar = findLidarByName(lidar_name);
113+
auto *lidar = findLidarByName(lidar_name);
114114
if (lidar == nullptr)
115115
throw VehicleControllerException(Utils::stringf("No lidar with name %s exist on vehicle", lidar_name.c_str()));
116116

117117
return lidar->getOutput();
118118
}
119119

120-
virtual vector<int> getLidarSegmentation(const std::string& lidar_name) const
121-
{
122-
auto *lidar = findLidarByName(lidar_name);
123-
if (lidar == nullptr)
124-
throw VehicleControllerException(Utils::stringf("No lidar with name %s exist on vehicle", lidar_name.c_str()));
120+
virtual vector<int> getLidarSegmentation(const std::string& lidar_name) const
121+
{
122+
auto *lidar = findLidarByName(lidar_name);
123+
if (lidar == nullptr)
124+
throw VehicleControllerException(Utils::stringf("No lidar with name %s exist on vehicle", lidar_name.c_str()));
125125

126-
return lidar->getSegmentationOutput();
127-
}
126+
return lidar->getSegmentationOutput();
127+
}
128128

129129
// IMU API
130130
virtual ImuBase::Output getImuData(const std::string& imu_name) const
@@ -257,26 +257,26 @@ class VehicleApiBase : public UpdatableObject {
257257
}
258258
};
259259

260-
private:
261-
const LidarBase* findLidarByName(const std::string& lidar_name) const
262-
{
263-
const LidarBase* lidar = nullptr;
264-
265-
// Find lidar with the given name (for empty input name, return the first one found)
266-
// Not efficient but should suffice given small number of lidars
267-
uint count_lidars = getSensors().size(SensorBase::SensorType::Lidar);
268-
for (uint i = 0; i < count_lidars; i++)
269-
{
270-
const LidarBase* current_lidar = static_cast<const LidarBase*>(getSensors().getByType(SensorBase::SensorType::Lidar, i));
271-
if (current_lidar != nullptr && (current_lidar->getName() == lidar_name || lidar_name == ""))
272-
{
273-
lidar = current_lidar;
274-
break;
275-
}
276-
}
277-
278-
return lidar;
279-
}
260+
private:
261+
const LidarBase* findLidarByName(const std::string& lidar_name) const
262+
{
263+
const LidarBase* lidar = nullptr;
264+
265+
// Find lidar with the given name (for empty input name, return the first one found)
266+
// Not efficient but should suffice given small number of lidars
267+
uint count_lidars = getSensors().size(SensorBase::SensorType::Lidar);
268+
for (uint i = 0; i < count_lidars; i++)
269+
{
270+
const LidarBase* current_lidar = static_cast<const LidarBase*>(getSensors().getByType(SensorBase::SensorType::Lidar, i));
271+
if (current_lidar != nullptr && (current_lidar->getName() == lidar_name || lidar_name == ""))
272+
{
273+
lidar = current_lidar;
274+
break;
275+
}
276+
}
277+
278+
return lidar;
279+
}
280280
};
281281

282282

AirLib/include/sensors/lidar/LidarBase.hpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@ class LidarBase : public SensorBase {
4545
return output_;
4646
}
4747

48-
const vector<int>& getSegmentationOutput() const
49-
{
50-
return segmentation_output_;
51-
}
48+
const vector<int>& getSegmentationOutput() const
49+
{
50+
return segmentation_output_;
51+
}
5252

5353
protected:
5454
void setOutput(const LidarData& output)
5555
{
5656
output_ = output;
5757
}
5858

59-
void setSegmentationOutput(vector<int>& segmentation_output)
60-
{
61-
segmentation_output_ = segmentation_output;
62-
}
59+
void setSegmentationOutput(vector<int>& segmentation_output)
60+
{
61+
segmentation_output_ = segmentation_output;
62+
}
6363

6464
private:
6565
LidarData output_;
66-
vector<int> segmentation_output_;
66+
vector<int> segmentation_output_;
6767
};
6868

6969
}} //namespace

AirLib/include/sensors/lidar/LidarSimple.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class LidarSimple : public LidarBase {
9393
ground_truth.kinematics->pose, // relative vehicle pose
9494
delta_time,
9595
point_cloud_,
96-
segmentation_cloud_
97-
);
96+
segmentation_cloud_
97+
);
9898

9999
LidarData output;
100100
output.point_cloud = point_cloud_;
@@ -104,13 +104,13 @@ class LidarSimple : public LidarBase {
104104
last_time_ = output.time_stamp;
105105

106106
setOutput(output);
107-
setSegmentationOutput(segmentation_cloud_);
107+
setSegmentationOutput(segmentation_cloud_);
108108
}
109109

110110
private:
111111
LidarSimpleParams params_;
112112
vector<real_T> point_cloud_;
113-
vector<int> segmentation_cloud_;
113+
vector<int> segmentation_cloud_;
114114

115115
FrequencyLimiter freq_limiter_;
116116
TTimePoint last_time_;

AirLib/src/api/RpcLibClientBase.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ int RpcLibClientBase::getMinRequiredClientVersion() const
103103
}
104104
int RpcLibClientBase::getServerVersion() const
105105
{
106-
return pimpl_->client.call("getServerVersion").as<int>();
106+
return pimpl_->client.call("getServerVersion").as<int>();
107107
}
108108

109109
void RpcLibClientBase::reset()
@@ -191,7 +191,7 @@ msr::airlib::DistanceBase::Output RpcLibClientBase::getDistanceSensorData(const
191191

192192
vector<int> RpcLibClientBase::simGetLidarSegmentation(const std::string& lidar_name, const std::string& vehicle_name) const
193193
{
194-
return pimpl_->client.call("simGetLidarSegmentation", lidar_name, vehicle_name).as<vector<int>>();
194+
return pimpl_->client.call("simGetLidarSegmentation", lidar_name, vehicle_name).as<vector<int>>();
195195
}
196196

197197
bool RpcLibClientBase::simSetSegmentationObjectID(const std::string& mesh_name, int object_id, bool is_name_regex)

AirLib/src/api/RpcLibServerBase.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ RpcLibServerBase::RpcLibServerBase(ApiProvider* api_provider, const std::string&
126126
return RpcLibAdapatorsBase::Pose(pose);
127127
});
128128

129-
pimpl_->server.
130-
bind("simGetLidarSegmentation", [&](const std::string& lidar_name, const std::string& vehicle_name) -> std::vector<int> {
131-
return getVehicleApi(vehicle_name)->getLidarSegmentation(lidar_name);
132-
});
129+
pimpl_->server.
130+
bind("simGetLidarSegmentation", [&](const std::string& lidar_name, const std::string& vehicle_name) -> std::vector<int> {
131+
return getVehicleApi(vehicle_name)->getLidarSegmentation(lidar_name);
132+
});
133133

134134
pimpl_->server.
135135
bind("simSetSegmentationObjectID", [&](const std::string& mesh_name, int object_id, bool is_name_regex) -> bool {

Unreal/Plugins/AirSim/Source/UnrealSensors/UnrealLidarSensor.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ void UnrealLidarSensor::getPointCloud(const msr::airlib::Pose& lidar_pose, const
4545
const msr::airlib::TTimeDelta delta_time, msr::airlib::vector<msr::airlib::real_T>& point_cloud, vector<int>& segmentation_cloud)
4646
{
4747
point_cloud.clear();
48-
segmentation_cloud.clear();
48+
segmentation_cloud.clear();
4949

5050
msr::airlib::LidarSimpleParams params = getParams();
5151
const auto number_of_lasers = params.number_of_channels;
@@ -90,14 +90,14 @@ void UnrealLidarSensor::getPointCloud(const msr::airlib::Pose& lidar_pose, const
9090
continue;
9191

9292
Vector3r point;
93-
int segmentationID = -1;
93+
int segmentationID = -1;
9494
// shoot laser and get the impact point, if any
9595
if (shootLaser(lidar_pose, vehicle_pose, laser, horizontal_angle, vertical_angle, params, point, segmentationID))
9696
{
9797
point_cloud.emplace_back(point.x());
9898
point_cloud.emplace_back(point.y());
9999
point_cloud.emplace_back(point.z());
100-
segmentation_cloud.emplace_back(segmentationID);
100+
segmentation_cloud.emplace_back(segmentationID);
101101
}
102102
}
103103
}
@@ -138,17 +138,17 @@ bool UnrealLidarSensor::shootLaser(const msr::airlib::Pose& lidar_pose, const ms
138138

139139
if (is_hit)
140140
{
141-
//Store the segmentation id of the hit object.
142-
auto hitActor = hit_result.GetActor();
143-
if (hitActor != nullptr)
144-
{
145-
TArray<UMeshComponent*> meshComponents;
146-
hitActor->GetComponents<UMeshComponent>(meshComponents);
147-
for (int i = 0; i < meshComponents.Num(); i++)
148-
{
149-
segmentationID = segmentationID == -1 ? meshComponents[i]->CustomDepthStencilValue : segmentationID;
150-
}
151-
}
141+
//Store the segmentation id of the hit object.
142+
auto hitActor = hit_result.GetActor();
143+
if (hitActor != nullptr)
144+
{
145+
TArray<UMeshComponent*> meshComponents;
146+
hitActor->GetComponents<UMeshComponent>(meshComponents);
147+
for (int i = 0; i < meshComponents.Num(); i++)
148+
{
149+
segmentationID = segmentationID == -1 ? meshComponents[i]->CustomDepthStencilValue : segmentationID;
150+
}
151+
}
152152

153153
if (false && UAirBlueprintLib::IsInGameThread())
154154
{

0 commit comments

Comments
 (0)