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

GPS sensor in Gazebo #519

Closed
wants to merge 3 commits into from
Closed

GPS sensor in Gazebo #519

wants to merge 3 commits into from

Conversation

Dotrar
Copy link

@Dotrar Dotrar commented Dec 30, 2020

Related issue:
gazebosim/gz-sensors#23
My pull requests: (This PR would depend on the following: )
gazebosim/gz-sensors#72
(which then depends on)
gazebosim/sdformat#453

Use the ign-sensor::Gps in the gazebo sim by creating a Gps-system

This was by far the hardest one to get going, not least due to the "binary/source" issue as mentioned by gazebosim/gz-tools#8

As mentioned on the sdformat issue, I've only made two simple noise systems that get applied unilaterally to each of the components.. If this doesn't suite I could change it.

I'm also really hoping that the use of sphericalCoords.PositionTransform() was correct because I wasn't quite sure on how it's meant to be used; or what a better way to use it ( ie: should the GPS store it's data in a SphericalCoords Type? )

Some notes:

  • I was thinking of putting in a "reference lat/lon" into the sdformat, so that one could specify where the gps starts out in the world file. but I couldn't see that on gazebo classic and I wasn't too sure how the gazebo classic gps function actually worked.

Dre Westcook added 3 commits December 30, 2020 19:39
Signed-off-by: Dre Westcook <dre.west@outlook.com>
Signed-off-by: Dre Westcook <dre.west@outlook.com>
Signed-off-by: Dre Westcook <dre.west@outlook.com>
@Dotrar Dotrar requested a review from chapulina as a code owner December 30, 2020 08:57
@github-actions github-actions bot added the 🔮 dome Ignition Dome label Dec 30, 2020
Comment on lines +184 to 185
</y>
<z>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
</y>
<z>
</y>
<z>

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2019 Open Source Robotics Foundation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Copyright (C) 2019 Open Source Robotics Foundation
* Copyright (C) 2020 Open Source Robotics Foundation

Comment on lines +865 to +867
_in.GpsSensor()->PositionNoise());

}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_in.GpsSensor()->PositionNoise());
}
_in.GpsSensor()->PositionNoise());
}

@@ -0,0 +1,239 @@
/*
* Copyright (C) 2019 Open Source Robotics Foundation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Copyright (C) 2019 Open Source Robotics Foundation
* Copyright (C) 2020 Open Source Robotics Foundation

Comment on lines +151 to +155
}


// set sensor parent
std::string parentName = _ecm.Component<components::Name>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
// set sensor parent
std::string parentName = _ecm.Component<components::Name>(
}
// set sensor parent
std::string parentName = _ecm.Component<components::Name>(

@@ -0,0 +1,66 @@
/*
* Copyright (C) 2019 Open Source Robotics Foundation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Copyright (C) 2019 Open Source Robotics Foundation
* Copyright (C) 2020 Open Source Robotics Foundation

Comment on lines +52 to +55
EntityComponentManager &_ecm) final;


/// Documentation inherited
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
EntityComponentManager &_ecm) final;
/// Documentation inherited
EntityComponentManager &_ecm) final;
/// Documentation inherited

@@ -0,0 +1,209 @@
/*
* Copyright (C) 2019 Open Source Robotics Foundation
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Copyright (C) 2019 Open Source Robotics Foundation
* Copyright (C) 2020 Open Source Robotics Foundation

Comment on lines +154 to +170
// velocity should be negative in z
//EXPECT_GT(velocities.front().Z(), velocities.back().Z());
//EXPECT_LT(velocities.back().Z(), 0.0);

// check gps sensor data

/*
// vertical position = world position - intial position
// so since gps is falling, vertical position should be negative
EXPECT_GT(firstMsg.vertical_position(),
lastMsg.vertical_position());
EXPECT_LT(lastMsg.vertical_position(), 0.0);
// vertical velocity should be negative
EXPECT_GT(firstMsg.vertical_velocity(),
lastMsg.vertical_velocity());
EXPECT_LT(lastMsg.vertical_velocity(), 0.0);
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove these lines

@ahcorde ahcorde added the needs upstream release Blocked by a release of an upstream library label Dec 30, 2020
@chapulina
Copy link
Contributor

Thank you again for all the work, @Dotrar . Since the fork has been deleted, I opened a new PR in #1248.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome needs upstream release Blocked by a release of an upstream library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants