Skip to content
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

Lidarimprovements #2011

Merged
merged 1 commit into from
Sep 13, 2019
Merged

Lidarimprovements #2011

merged 1 commit into from
Sep 13, 2019

Conversation

ironclownfish
Copy link
Contributor

Added an api function: simGetLidarSegmentation().
Returns the segmentation of each lidar point's collided object in the last lidar update. i.e. the segmentation IDs align with getLidarData().point_cloud

@@ -160,7 +160,8 @@ void ASimModeBase::initializeTimeOfDay()
UObjectProperty* sun_prop = Cast<UObjectProperty>(p);
UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_);
sun_ = Cast<ADirectionalLight>(sun_obj);
default_sun_rotation_ = sun_->GetActorRotation();
if (sun_)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this change.
same as #2062.
(this seems like a git merge issue on your side to me (we don't need optionsmenu.uasset && BP_LevelLoadButton.uasset))
please remove them as well if so

@@ -75,6 +75,9 @@ class RpcLibClientBase {
msr::airlib::GpsBase::Output getGpsData(const std::string& gps_name = "", const std::string& vehicle_name = "") const;
msr::airlib::DistanceBase::Output getDistanceSensorData(const std::string& distance_sensor_name = "", const std::string& vehicle_name = "") const;

// sensor omniscient APIs
vector<int> simGetLidarSegmentation(const std::string& lidar_name = "", const std::string& vehicle_name = "") const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should just call this getLidarSegmentationData to keep it in line with getLidarData?

break;
}
}
auto *lidar = findLidarByName(lidar_name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this function, but I don't like the inconsistent indentation

@@ -260,6 +256,27 @@ class VehicleApiBase : public UpdatableObject {
: VehicleControllerException(message) {
}
};

private:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

@@ -68,7 +68,7 @@ class LidarSimple : public LidarBase {

protected:
virtual void getPointCloud(const Pose& lidar_pose, const Pose& vehicle_pose,
TTimeDelta delta_time, vector<real_T>& point_cloud) = 0;
TTimeDelta delta_time, vector<real_T>& point_cloud, vector<int>& segmentation_cloud) = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to have a different sensor - LidarSimpleSegmentation which has the segmentation IDs per point?
I am not sure how much is the effect of getting segmentation IDs is on a pure geometric lidar in the backend, as the end user may / may not need getSegmentationOutput

If you have a different sensor, you can have getLidarSegmentationData which can a return a object of type msr::airlib::LidarDatawithSegmentation (or a innocuously misleading msr::airlib::LidarSegmentationData), which contains XYZSegID

latter seems a more cleaner API to me

@@ -102,11 +104,13 @@ class LidarSimple : public LidarBase {
last_time_ = output.time_stamp;

setOutput(output);
setSegmentationOutput(segmentation_cloud_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation.. elsewhere as well

@@ -203,6 +206,9 @@
<ClInclude Include="Unreal\Plugins\AirSim\Source\Weather\WeatherLib.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Unreal\Plugins\AirSim\Source\UnrealSensors\UnrealLidarSensor.h">
<Filter>Source Files</Filter>
</ClInclude>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda surprised that this was already not in the upstream vcxproj

@madratman
Copy link
Contributor

@ironclownfish see above.
@bmalhigh can you do a sanity check?

@madratman
Copy link
Contributor

also, please add documentation for this
same for simListSceneObjects

Returns the segmentation of each lidar point's collided object in the last lidar update. i.e. the segmentation IDs align with getLidarData().point_cloud
@msb336 msb336 merged commit c6f835c into microsoft:master Sep 13, 2019
msb336 pushed a commit to msb336/AirSim that referenced this pull request Oct 1, 2019
…finition in

UnrealLidarSensor::getPointCloud from vector to msr::airlib::vector
madratman added a commit that referenced this pull request Oct 1, 2019
fixed type naming error created by PR #2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants