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

[WIP] Set framework to define offset between global origin and current local position #691

Merged
merged 15 commits into from
Jun 7, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions mavros/src/plugins/global_position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ class GlobalPositionPlugin : public plugin::PluginBase {

g_origin->header.frame_id = frame_id;
g_origin->header.stamp = ros::Time::now();
g_origin->position.latitude = glob_orig.latitude; // @warning TODO: #529
g_origin->position.longitude = glob_orig.longitude;
g_origin->position.altitude = glob_orig.altitude;
g_origin->position.latitude = (double)glob_orig.latitude; // @warning TODO: #529
g_origin->position.longitude = (double)glob_orig.longitude;
g_origin->position.altitude = (double)glob_orig.altitude;
Copy link
Member

Choose a reason for hiding this comment

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

Read message documentation! That is not how you should convert int32 encoded coord's to floating point.


gp_global_origin_pub.publish(g_origin);
}
Expand Down Expand Up @@ -342,9 +342,9 @@ class GlobalPositionPlugin : public plugin::PluginBase {
// for f in ('latitude', 'longitude', 'altitude'):
// cog.outl("gpo.%s = req->%s;" % (f, f))
// ]]]
gpo.latitude = req->position.latitude;
gpo.longitude = req->position.longitude;
gpo.altitude = req->position.altitude;
gpo.latitude = (int32_t)req->position.latitude;
gpo.longitude = (int32_t)req->position.longitude;
gpo.altitude = (int32_t)req->position.altitude;
// [[[end]]] (checksum: 283da7efac0ea8cccd0d5e144ca29a03)

UAS_FCU(m_uas)->send_message_ignore_drop(gpo);
Expand Down