Skip to content

Commit

Permalink
DTOR
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <louise@openrobotics.org>
  • Loading branch information
chapulina committed Nov 30, 2021
1 parent 6007b1e commit e1eecdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
9 changes: 3 additions & 6 deletions lrauv_ignition_plugins/src/ScienceSensorsSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class tethys::ScienceSensorsSystemPrivate
/// Vector size: number of time slices. Indices correspond to those of
/// this->timestamps.
/// Point cloud: spatial coordinates to index science data by location
/// in the ENU world frame.
public: std::vector<pcl::PointCloud<pcl::PointXYZ>::Ptr> timeSpaceCoords;

/// \brief Science data.
Expand Down Expand Up @@ -429,9 +430,10 @@ void ScienceSensorsSystemPrivate::ReadData(
{
// Convert lat / lon / elevation to Cartesian ENU
auto cart = this->world.SphericalCoordinates(_ecm).value()
.PositionTransform({latitude, longitude, -depth},
.PositionTransform({IGN_DTOR(latitude), IGN_DTOR(longitude), 0.0},
ignition::math::SphericalCoordinates::SPHERICAL,
ignition::math::SphericalCoordinates::LOCAL2);
cart.Z() = -depth;

// Gather spatial coordinates, 3 fields in the line, into point cloud
// for indexing this time slice of data.
Expand Down Expand Up @@ -819,11 +821,6 @@ ignition::msgs::PointCloudPacked ScienceSensorsSystemPrivate::PointCloudMsg()
{"xyz", ignition::msgs::PointCloudPacked::Field::FLOAT32},
});

// TODO optimization for visualization:
// Use PCL methods to chop off points beyond some distance from sensor
// pose. Don't need to visualize beyond that. Might want to put that on a
// different topic specifically for visualization.

msg.mutable_header()->mutable_stamp()->set_sec(this->timestamps[this->timeIdx]);

pcl::PCLPointCloud2 pclPC2;
Expand Down
4 changes: 0 additions & 4 deletions lrauv_ignition_plugins/src/VisualizePointCloud.cc
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,6 @@ void VisualizePointCloud::PublishMarkers()

// Index of point in point cloud, visualized or not
int ptIdx{0};
// Number of points actually visualized
int nPtsViz{0};
auto minC = this->dataPtr->minColor;
auto maxC = this->dataPtr->maxColor;
for (;iterX != iterX.end() &&
Expand Down Expand Up @@ -401,8 +399,6 @@ void VisualizePointCloud::PublishMarkers()
*iterX,
*iterY,
*iterZ));

++nPtsViz;
}

igndbg << "Visualizing " << marker.point_size() << " points"
Expand Down

0 comments on commit e1eecdd

Please sign in to comment.