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

AP_DDS: Local Pose Publisher #23480

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

pedro-fuoco
Copy link
Contributor

Resolves #23278, here is the PR working on SITL:
Screenshot from 2023-04-14 00-08-55
The NED to ENU conversion seemed fine when I analysed the position coordinates of a plane flying in SITL. As you can see in the screenshot the plane went North-West after takeoff which resulted in a negative X axis (points towards east in ENU) and a positive Y axis (points towards north in ENU). Z is positive after takeoff.

libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch from 0bb3723 to d3250a7 Compare April 14, 2023 04:06
@pedro-fuoco pedro-fuoco changed the title AP_DDS: Local Position Publisher AP_DDS: Local Pose Publisher Apr 14, 2023
@pedro-fuoco
Copy link
Contributor Author

pedro-fuoco commented Apr 14, 2023

PoseOnFoxglove
@Ryanf55 Figured out how to validate orientations on foxglove, they are wrong apparently lol. Will fix them soon to follow the

// In ROS REP 103, it follows this convention
        // X - Forward
        // Y - Left
        // Z - Up
        // https://www.ros.org/reps/rep-0103.html#axis-orientation

@Ryanf55
Copy link
Collaborator

Ryanf55 commented Apr 14, 2023

PoseOnFoxglove PoseOnFoxglove @Ryanf55 Figured out how to validate orientations on foxglove, they are wrong apparently lol. Will fix them soon to follow the

// In ROS REP 103, it follows this convention
        // X - Forward
        // Y - Left
        // Z - Up
        // https://www.ros.org/reps/rep-0103.html#axis-orientation

In foxglove 3D, FYI I'm about 75% sure that X corresponds to red, so if the vehicle is traveling straight, red is pointing into the wind. Then green for left, and blue for up (towards sky).

XYZ = RGB

It's hard to tell from the gif, but I'll verify this on my side when you think it's good.

Glad we checked.

libraries/AP_DDS/AP_DDS_Client.cpp Outdated Show resolved Hide resolved
libraries/AP_DDS/AP_DDS_Client.cpp Show resolved Hide resolved
@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch from d3250a7 to 2ff8418 Compare April 14, 2023 17:37
@Ryanf55 Ryanf55 added ROS For-4.5 Planned for 4.5 release labels Apr 14, 2023
@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch from 2ff8418 to 19052fa Compare April 17, 2023 23:52
@pedro-fuoco
Copy link
Contributor Author

pedro-fuoco commented Apr 18, 2023

I researched quite a bit to see if I got the orientation right.
This is what I was looking for.

We are not using a body-fixed frame on the local pose topic.
X-forward refers to a body-fixed frames, so there is no reason for X to be pointing forward in this case.
Notice how we are still following ros rep 103:

For short-range Cartesian representations of geographic locations, use the [east north up](http://en.wikipedia.org/wiki/Geodetic_datum#Local_east.2C_north.2C_up_.28ENU.29_coordinates) [[5]](https://www.ros.org/reps/rep-0103.html#id9) (ENU) convention:
X east
Y north
Z up

There should be a dicussion about using a body-fixed frame in the local velocity topic though

@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch from 19052fa to 9bb24cf Compare April 18, 2023 03:28
@Ryanf55
Copy link
Collaborator

Ryanf55 commented Apr 24, 2023

Just tested in ROS 2 humble NAV2 bringup. The frame shown in RVIZ below is the base_link frame. wafflle is facing "north".
image

If waffle turns 45 degrees to the left, now facing northwest, it looks like this. I also zoomed out, so you can see map and odom, which are on top of each other.
image

base_link is in body frame, since it's attached to the robot body, so let's abide by the convention you posted above from TSC21's original clarifications, which also conveniently match the behavior in NAV2, which we hope to support easy integration with.

Expectation (In SITL+Foxglove):
If the drone is flying north, the red arrow (X) should point north, the green arrow (Y) points west, and the blue arrow (Z) points towards the sky.
If the drone is flying northwest, the red arrow (X) should point northwest, the green arrow (Y) points southwest, and the blue arrow (Z) remains towards the sky.

Hope that clears it up.

@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch 2 times, most recently from a340985 to 1286b09 Compare April 24, 2023 18:35
@pedro-fuoco
Copy link
Contributor Author

pedro-fuoco commented Apr 24, 2023

@Ryanf55 Thanks a lot for the clarifications!
Just fixed it up to follow x-forward, y-left, z-up orientation! Here are my recent tests in foxglove:
ezgif-5-25253dae3e
Also updated the comments so that the transformations are clear. As soon as this gets reviewed I will change #23540 to follow this transformation as well

@pedro-fuoco pedro-fuoco requested a review from Ryanf55 April 24, 2023 18:41
@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch from 1286b09 to 62b7278 Compare April 24, 2023 19:26
@pedro-fuoco pedro-fuoco force-pushed the dds-local-position-publisher branch from 62b7278 to 5c56218 Compare April 24, 2023 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For-4.5 Planned for 4.5 release ROS
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

AP_DDS: Add support for PoseStamped
6 participants