-
Notifications
You must be signed in to change notification settings - Fork 241
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
Bugfix frame usage #55
Conversation
use the NavSatFix as link between geo coordinates and Cartesian, update readme and demo accordingly, closes #35
Would this also work regarding the orientation if your |
Thanks for the contribution! But I don't get why you pull in another frame (nav_sat_fix_base) and do the complex computation of "where is my robot relative to nav_sat_fix_base expressed in WGS84 coordinates". Further, why are you deleting FRAME_CONVENTION_XYZ_NED and FRAME_CONVENTION_XYZ_NWU support? |
Would it be an idea to let the user of this plugin decide on how to use (or fuse) the |
yes, there are no constraints regarding the frame, just keep in mind that if you do that, the orientation of the robot is defined as "north", which is probably not what you want
To avoid the often mentioned "jumping" and to avoid the need for multiple
In order to keep the transformations simple, if you want another frame convention, you can simply rotate the
Instead of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's not a good idea to require the frame nav_sat_fix_base
to be in ENU.
Could you elaborate on why you are using UTM in the first place? a8d2e20 says that it's due to allow a selectable rviz fixed frame (what does this mean?)
Personally, I prefer #53 over this PR. It's much simpler. Could you elaborate on the additional value of this PR in contrast to #53?
new RosTopicProperty("Topic", "", QString::fromStdString(ros::message_traits::datatype<sensor_msgs::NavSatFix>()), | ||
"nav_msgs::Odometry topic to subscribe to.", this, SLOT(updateTopic())); | ||
topic_property_ = new RosTopicProperty( | ||
"NavSatFix", "", QString::fromStdString(ros::message_traits::datatype<sensor_msgs::NavSatFix>()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't rename the property from Topic
to NavSatFix
in order to keep backwards compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, but "topic" is not the best name for a plugin that does not simply visualize a message. What kind of backwards compatibility do you mean?
@@ -96,11 +100,11 @@ AerialMapDisplay::AerialMapDisplay() : Display(), dirty_(false), received_msg_(f | |||
blocks_property_->setMax(maxBlocks); | |||
|
|||
frame_convention_property_ = | |||
new EnumProperty("Frame Convention", "XYZ -> ENU", "Convention for mapping cartesian frame to the compass", this, | |||
SLOT(updateFrameConvention())); | |||
new EnumProperty("Frame Convention", "XYZ -> ENU", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the value of having a Frame Convention
property with only one option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a hint to people previously using other frame conventions, and I prefer it over simply deleting this option without telling which one is used now.
|
||
frame_property_ = new TfFrameProperty("Robot frame", "world", "TF frame for the moving robot.", this, nullptr, false, | ||
SLOT(updateFrame()), this); | ||
frame_property_ = new TfFrameProperty("Robot frame", "robot", "TF frame for the moving robot, must be connected to " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to backwards compatibility this name shouldn't be Robot frame
and something different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this actually is the robot frame (for the first time), so why shouldn't it be named that way?
|
||
frame_property_ = new TfFrameProperty("Robot frame", "world", "TF frame for the moving robot.", this, nullptr, false, | ||
SLOT(updateFrame()), this); | ||
frame_property_ = new TfFrameProperty("Robot frame", "robot", "TF frame for the moving robot, must be connected to " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your reasoning behind making Robot frame
configurable? Isn't this basically always the frame map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is the frame of the robot, below which you want the tiles to be loaded
setStatus(StatusProperty::Error, "Transform", QString::fromStdString(errMsg)); | ||
setStatus(StatusProperty::Error, "README", | ||
QString::fromStdString("Tiles might be visible, but in the wrong place!")); | ||
// todo: replace this readme by hiding the tiles in a way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This todo has to be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but it's not an issue I introduced, it always existed, and I do want to contribute, yet not fix everything ;)
see #51
Feel free to add that functionality, again, I didn't remove it.
Yes it is simpler, but also has less functionality. If you have a robot moving around in the world, it does not necessarily carry a GPS receiver, still you might want to visualize the environment in which it is moving. So you provide one GPS location in the area, and with UTM we can always compute the correct tiles to be loaded. If you have multiple robots running around in your setup, they can currently not be far away from each other, because a maximum of 8 tiles is loaded around the given position. With this PR, you can simply change the robot frame. Tiles are in lat/lon, |
In your example,
You wouldn't need to publish the
I removed it because I only tested tud-cor@a8d2e20 in the case of ENU convention. My intention was to add it again if tested for NED/NWU.
I agree that it would not be convenient to require the user to configure a UTM frame, since that information can be derived from a
You can choose the 'fixed frame' in rviz in the 'Displays' window in the 'Global Options' field. |
Well, the question is, what is the alternative? You have to specify the coordinate system, in which the ENU (or whatever convention) is applied. What you are doing, is just assuming that it applies to the "fixed frame" of rviz, meaning that if someone changes the fixed frame to the vehicle frame, for example to speed up point cloud visualizations around the car, then the plugin draws the map with the wrong orientation, as stated above. And with your implementation, you can't do anything about that. My implementation, however, allows for any correct usage of the frames, without constraining rviz' fixed frame, for example.
You always need a
ok |
The alternative would be to let the user of this plugin decide on how to use the
I am not making assumptions about the fixed frame in rviz. In fact, the reason why I created tud-cor@a8d2e20 is to allow any fixed frame to be selected. However, tud-cor@a8d2e20 does require the
The point I wanted to make is that I think that it would make sense to connect |
A Why using some extra UTM, maybe some people use UTM with an offset, as OGRE uses The need for a This PR of course also does not suffer from #56, as you can imagine |
Does this not have the implicit assumption that the |
It does have the explicit assumption that the NavSatFix's frame_id is aligned with ENU/NED/NWU. What you simply have to do is provide a frame for which this assumption is correct, which is rotated w.r.t. the robot frame. In your setup, I assume you have a GPS any maybe some additional sensor to help determining the orientation(, or you determine it simply by GPS differences, which would be quite jumpy). So I'd suggest to use one frame for the GPS sensor with an ENU frame, such as |
I have to agree with Ronald here. We should avoid making assumptions about the use case or orientations of frames. The plugin should work out of the box for most use cases.
I think that this is a pretty niche use case. If there is more demand for this feature though, I'm happy to add this functionality. Currently, I'd prefer if you do the transform from the NavSatFix to the robot frame outside of this plugin and then publish a fake NavSatFix with that frame. That should work with #53 |
Exactly this is the motivation of this PR
Where do you apply the ENU convention then? I think the latter is the one making assumptions about the use case or orientations of frames... |
From https://www.ros.org/reps/rep-0105.html#map
For your setup, you might want to look into the earth frame definition. In order to be compliant to the earth frame definition, the user would need to select "map_1", "map_2", etc. However, no one ever had this feature request. Until now? ;) |
Okay, I agree, that might be valid for most use cases. It should be added to the description of the What remains is the jumping (#56), in case the I could update this PR to use |
A bit of a late reply from my side. I think I just have a different preference compared to @m-naumann, since I would like to visualize the tiles based on where my sensor fusion algorithm thinks the car is. Because of that, I have a preference to use Regarding the float precision in Ogre and the use of a UTM frame: If you're interested, I have made some modifications here https://github.com/tud-cor/rviz_satellite/tree/761df89985a1e11d6bdacef5b70574db8598bd1d, that allows transforming the tile in a frame closer to the car (using double precision) before drawing (single precision). I do not see differences. Be aware that this is only a visual comparison and only tested on one specific data set. (edit: the subsequent commit tud-cor@a3a7b5c fixes utm meridian convergence). |
This is what it does:
See the demo launchfile for an example with 4 frames:
fixed_frame
: the arbitrarily chosen fixed frame in rvizmap
: some base frame you might want to usenav_sat_fix_base
: the one frame you know the GPS coordinate, that's where XYZ > ENU is assumedrobot
: the robot that moves around in the world, orientation does not matter for loading the tiles, as XYZ > ENU is assumed for the abovenav_sat_fix_base
BTW, that is "Option 2" as explained here: #35 (comment)