open-rmf / rmf_traffic_editor

GUI, CLI, and ROS 2 messages for robot traffic flows in buildings
Apache License 2.0
138 stars 67 forks source link

X and Y value in traffic editor is different from nav_graph generated by compilation #391

Open destkk opened 3 years ago

destkk commented 3 years ago

Ubuntu 20.04 Ros2 Foxy

I am trying to create a 3 levels map in traffic editor using a 3 different level floor plan + map created by a robot. I have overlay the robot map and keying in an offset so the origin (0,0) for all 3 levels are the same.

The waypoints that have been created for the first floor are accurate when I compare the x and y of the waypoint in traffic editor and nav_graph generated after compilation.

However, the waypoints for the 2nd and 3rd floor are different in terms of the y value has an increasing difference as the waypoint gets further from the origin.

I have added fiducials for all 3 floors to make it align but the fact is due to the robot mapping all 3 levels are not exactly aligned with one another.

May I know in order to resolve this do I have to rotate the map to make it align with each other for me to add the fiducial? Or is there any other suggestions that I could resolve this.

codebot commented 3 years ago

Indeed, fiducials are the intended way to address this situation, which as you mentioned is unavoidable when aligning floors. I realize the fiducial tool is not well documented at the moment. The “trick” to making it work is that each fiducial that you want to be aligned must be named the same on all levels. For example, if one fiducial is a pillar of a car park, it should be named “carpark_pillar” (or some other string) on all levels in which it appears.

To debug the fiducial alignment, the build log for the nav graph generator should contain the names of the fiducials that it found and how they are paired to generate constraints for the alignment process. Note that at least two common fiducials are required in order to solve for all parameters (x, y translation, scale, and yaw rotation). The more fiducials you add, the better, to compensate for mapping errors. Depending on the size of the space, I would suggest starting with three or four.

On Sun, 19 Sep 2021 at 7:55 PM, destkk @.***> wrote:

Ubuntu 20.04 Ros2 Foxy

I am trying to create a 3 levels map in traffic editor using a 3 different level floor plan + map created by a robot. I have overlay the robot map and keying in an offset so the origin (0,0) for all 3 levels are the same.

The waypoints that have been created for the first floor are accurate when I compare the x and y of the waypoint in traffic editor and nav_graph generated after compilation.

However, the waypoints for the 2nd and 3rd floor are different in terms of the y value has an increasing difference as the waypoint gets further from the origin.

I have added fiducials for all 3 floors to make it align but the fact is due to the robot mapping all 3 levels are not exactly aligned with one another.

May I know in order to resolve this do I have to rotate the map to make it align with each other for me to add the fiducial? Or is there any other suggestions that I could resolve this.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/open-rmf/rmf_traffic_editor/issues/391, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIFDWQCPN3PWEINK2F6OSLUCXFTJANCNFSM5EKIJ7DA .

destkk commented 3 years ago

Indeed, fiducials are the intended way to address this situation, which as you mentioned is unavoidable when aligning floors. I realize the fiducial tool is not well documented at the moment. The “trick” to making it work is that each fiducial that you want to be aligned must be named the same on all levels. For example, if one fiducial is a pillar of a car park, it should be named “carpark_pillar” (or some other string) on all levels in which it appears. To debug the fiducial alignment, the build log for the nav graph generator should contain the names of the fiducials that it found and how they are paired to generate constraints for the alignment process. Note that at least two common fiducials are required in order to solve for all parameters (x, y translation, scale, and yaw rotation). The more fiducials you add, the better, to compensate for mapping errors. Depending on the size of the space, I would suggest starting with three or four. On Sun, 19 Sep 2021 at 7:55 PM, destkk @.***> wrote: Ubuntu 20.04 Ros2 Foxy I am trying to create a 3 levels map in traffic editor using a 3 different level floor plan + map created by a robot. I have overlay the robot map and keying in an offset so the origin (0,0) for all 3 levels are the same. The waypoints that have been created for the first floor are accurate when I compare the x and y of the waypoint in traffic editor and nav_graph generated after compilation. However, the waypoints for the 2nd and 3rd floor are different in terms of the y value has an increasing difference as the waypoint gets further from the origin. I have added fiducials for all 3 floors to make it align but the fact is due to the robot mapping all 3 levels are not exactly aligned with one another. May I know in order to resolve this do I have to rotate the map to make it align with each other for me to add the fiducial? Or is there any other suggestions that I could resolve this. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#391>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIFDWQCPN3PWEINK2F6OSLUCXFTJANCNFSM5EKIJ7DA .

Hello. Thanks for the prompt reply. Please refer to the screenshot below for the 3 maps mapped by the robot. I have tried to add the fiducials for the 3 levels using the lift as the reference point but apparently i still face the same issue as mentioned above. The nav_graph of the 1st floor is accurate while the other 2 is not.

Screenshot from 2021-09-20 10-03-59 Screenshot from 2021-09-20 10-04-01 Screenshot from 2021-09-20 10-04-03

For example, you can see the screenshot below for the x and y value of L2 for this particular waypoint, x = 35.12, y = 4.473.

But according to the nav_graph it shows

      - 34.98805463852676
      - 5.074628842552811
      - {name: WP27}

Screenshot from 2021-09-20 10-06-52

Another waypoint is x = 76.49, y = 17.

But according to the nav_graph it shows

      - 76.16944644317378
      - 18.23107428374425
      - {name: WP33}

Screenshot from 2021-09-20 10-09-20

I am not too sure what steps should i take to resolve this issue.

codebot commented 3 years ago

I guess I don't totally understand the issue -- is there a problem with the generated nav graph (either in simulation or in real-world experiments), or is it primarily a question as to why the numbers are different in the traffic-editor GUI versus the generated nav graph?

As to why they are different: the two coordinates are doing different things:

Thank you for providing the screenshots. A few questions/suggestions:

codebot commented 2 years ago

This issue may end up being related to #419 , where the coordinates shown in the "x(m)" and "y(m)" fields in the vertex properties panel are scaled, but not translated, by the world transform of the level in the generated simulation model and navigation graph. I'll find a way to compute the "fully translated" vertex coordinates, so that they will match what appears in the output products of the build process.