-
Notifications
You must be signed in to change notification settings - Fork 21
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
Correct /tf
calculation for base tracks
#172
Conversation
I'll do a full review + test later, but as a first high-level comment: #78 includes the start of a more fleshed out M+ We could consider making that part of this PR instead: would help reduce the duplication, and reflect intent better. (note: the referenced code obviously is also incorrect, just as the code changed/fixed by this PR, but that's a detail) |
I'll probably refactor this a bit so we can add tests. That would also increase trust in these parts of the code. |
A quick test of the TF now being broadcast: X axis displacement is now taken into account, so the main issue seems resolved. We might want to open a discussion to see whether it'd be possible to include a Y and/or Z component as well (either through the config file, or via some other calibration that we may have available on the controller). As-is, this is currently not usable by applications, unless another transform (broadcast by something else) adds the Z offset -- but making another frame parent of Edit: we could perhaps rename Example: setting
another option could be the allow renaming all TF frames, instead of just prefixing. |
This is determined by the configuration of the robot during initial configuration. Then the direction of travel is taken into account here: motoros2/src/PositionMonitor.c Lines 296 to 304 in 9492838
While I was debugging, I configured a I don't think it makes sense to make the direction "configurable" from the software side. The robot is going to be physically mounted to the track in a certain orientation. Plus we want the position reported by ROS to match what is shown on the teach pendant. (If you look at current-position on your pendant in base-frame, it will show travel along the x axis.)
I'm not sure what you mean here. Are you referring to the height of the track relative to the floor? The offset from the track-origin to the robot-origin is configured by Yaskawa during integration/commissioning. This is the motoros2/src/PositionMonitor.c Line 308 in 9492838
I'm going to rely on you to dictate naming conventions.
This seems excessive. |
See below.
No, that's not what I was thinking of. And I agree with what you write.
This was what I was thinking of. It looks like this just wasn't done for my robot + track here. So from the ROS 2 perspective, my robot is always "on the floor". I'll just need to update that info on my controller.
I'll think about it a bit more, but I believe it would make sense.
There's a very good chance more complex applications would have that not coincident with the
Users using a URDF or XACRO (from one of our description packages fi) would have that freedom though. |
Only support MP_COORD -> geometry_msgs/{Pose,Transform} for now, but others can be added later.
Reduce duplication of conversion code.
So they can more easily be reused by other tests (in other files).
A naive first implementation of some tests.
@ted-miller: I've slightly refactored the I've also added a couple of tests for the new functions, and while doing that, I've refactored some of the utility functions and put them in a separate file. Output of the unit tests:
It's just some very simple tests, but they should show the new functions are not doing anything really crazy. I've also verified again the TF broadcast by this refactored version and everything still looks like it did in #172 (comment). Seeing as I've now added commits to this PR as well: could you please review it and let me know whether you agree with the changes? |
src/Tests_TestUtils.c
Outdated
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.
we might want to start thinking about migrating to a "real" C testing library.
To not drown in the rest of the output.
76d41e1
to
8950ca5
Compare
Everything looks good to me. |
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.
Tested on a YRC1 + GP25 + TSL1000.
Fixes #170
Two problems:
1.234 m
was getting converted to1 um
.