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

Convert science data from lat/lon to ENU #98

Merged
merged 6 commits into from
Dec 3, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Nov 30, 2021

This is an alternative to #70. Currently on main, science sensors is publishing data in lat/lon, and the GUI is treating these values as ENU cartesian coordinates.

Here's what the default dataset looks like:

temp222

simple_test.csv:

diff to use it

diff --git a/lrauv_ignition_plugins/src/ScienceSensorsSystem.cc b/lrauv_ignition_plugins/src/ScienceSensorsSystem.cc
index 882972c..e0afb09 100644
--- a/lrauv_ignition_plugins/src/ScienceSensorsSystem.cc
+++ b/lrauv_ignition_plugins/src/ScienceSensorsSystem.cc
@@ -195,9 +195,9 @@ class tethys::ScienceSensorsSystemPrivate
   // For 2003080103_mb_l3_las_1x1km.csv
   //public: const float MINIATURE_SCALE = 0.01;
   // For 2003080103_mb_l3_las.csv
-  public: const float MINIATURE_SCALE = 0.0001;
+  // public: const float MINIATURE_SCALE = 0.0001;
   // For simple_test.csv
-  //public: const float MINIATURE_SCALE = 1.0;
+  public: const float MINIATURE_SCALE = 1.0;
 
   // TODO This is a workaround pending upstream Marker performance improvements.
   // \brief Performance trick. Skip depths below this z, so have memory to
diff --git a/lrauv_ignition_plugins/worlds/buoyant_tethys.sdf b/lrauv_ignition_plugins/worlds/buoyant_tethys.sdf
index 7e73ea6..8a264c0 100644
--- a/lrauv_ignition_plugins/worlds/buoyant_tethys.sdf
+++ b/lrauv_ignition_plugins/worlds/buoyant_tethys.sdf
@@ -63,16 +63,16 @@
       <world_frame_orientation>ENU</world_frame_orientation>
 
       <!-- For 2003080103_mb_l3_las.csv -->
-      <latitude_deg>35.5999984741211</latitude_deg>
-      <longitude_deg>-121.779998779297</longitude_deg>
+      <!--latitude_deg>35.5999984741211</latitude_deg>
+      <longitude_deg>-121.779998779297</longitude_deg-->
 
       <!-- For 2003080103_mb_l3_las_1x1km.csv -->
       <!--latitude_deg>36.8024781413352</latitude_deg>
       <longitude_deg>-121.829647676843</longitude_deg-->
 
       <!-- For simple_test.csv -->
-      <!--latitude_deg>0</latitude_deg>
-      <longitude_deg>0</longitude_deg-->
+      <latitude_deg>0</latitude_deg>
+      <longitude_deg>0</longitude_deg>
 
       <elevation>0</elevation>
       <heading_deg>0</heading_deg>
@@ -80,9 +80,9 @@
     <plugin
       filename="ScienceSensorsSystem"
       name="tethys::ScienceSensorsSystem">
-      <data_path>2003080103_mb_l3_las.csv</data_path>
+      <!--data_path>2003080103_mb_l3_las.csv</data_path-->
       <!--data_path>2003080103_mb_l3_las_1x1km.csv</data_path-->
-      <!--data_path>simple_test.csv</data_path-->
+      <data_path>simple_test.csv</data_path>
     </plugin>
 
     <gui fullscreen="0">

temp_333

Changes:

  • Reduced the lat/lon in simple_test so they're closer to the origin
  • Restored the spherical coordinate change detection that was introduced in Science sensors: detect when spherical coordinates are set #77 and had been removed in Break up #70 - visualization only, no lat/long to Cartesian conversion #93
  • Delay reading the data until we have spherical coordinates
  • Use the world's spherical coordinates to convert each data point from lat/lon to Gazebo's coordinates, which are ENU (more info about coordinates in Fix coordinate frames on state message #81 )
  • Handle sensor coordinates in ENU instead of lat/lon for simplicity
  • Removed performance tricks from the GUI plugin which were duplicates of the server plugin (i.e. if we're not publishing markers below a certain depth, the GUI isn't receiving those points anyway)
  • Also removed logic to scale the voxels. As far as I understand, they weren't working as intended, because the resulting boxes weren't touching each other. The main motivation to remove that logic is that it needs to be tuned for each world and was making it hard to test different worlds. The boxes will go away on Visualize science data as points #88 anyway.

Signed-off-by: Louise Poubel <louise@openrobotics.org>
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina mentioned this pull request Nov 30, 2021
11 tasks
Signed-off-by: Louise Poubel <louise@openrobotics.org>
@chapulina chapulina self-assigned this Nov 30, 2021
Signed-off-by: Louise Poubel <louise@openrobotics.org>
Copy link
Collaborator

@mabelzhang mabelzhang left a comment

Choose a reason for hiding this comment

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

I've tested on both the real data and simple_test.
Let's get it in so I can merge into my interpolation PR! Thank you for iterating with me!

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.

2 participants