-
Notifications
You must be signed in to change notification settings - Fork 272
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
Also initialize non-joint components #822
Conversation
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.
Thanks! This is great!
Excellent idea with the example in ros2_control_demos
.
Could you also add a test for this in this file? It should be straightforward. One should add another xml
example and then check if parsing is good. There is already test for other initial values. Extending that test would also be fine.
sure! |
3e5efb2
to
e4508f5
Compare
Oh, I was not aware, that by re-requesting a review I would remove other potential reviewers. Sorry if I destroyed the workflow there. |
No this shouldn't be happening. It's not your fault! |
FYI: I just converted it to draft and back to re-trigger reviewer-lottery workflow. (closing was unintentional :D) |
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 looks great! Thanks!
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.
Thanks for following up!
Before, only joints were reading the initial value parameter. However, also sensors and gpios can have configured initial values.
e4508f5
to
406b834
Compare
Codecov Report
@@ Coverage Diff @@
## master #822 +/- ##
==========================================
- Coverage 34.61% 32.57% -2.05%
==========================================
Files 52 91 +39
Lines 2981 9295 +6314
Branches 1855 6251 +4396
==========================================
+ Hits 1032 3028 +1996
- Misses 310 720 +410
- Partials 1639 5547 +3908
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Any updates on merging this? The failing tests seem to be unrelated but I might be wrong there. |
@Mergifyio backport humble |
✅ Backports have been created
|
Co-authored-by: Denis Štogl <denis@stoglrobotics.de> (cherry picked from commit f1302cb)
…-controls#991) * [MockHardware] Enalbe initialization non-joint components(ros-controls#822) Co-authored-by: Denis Štogl <denis@stoglrobotics.de> (cherry picked from commit f1302cb) * Fixup tests. --------- Co-authored-by: Felix Exner <exner@fzi.de> Co-authored-by: Denis Štogl <denis@stoglrobotics.de>
…r.yaml. (ros-controls#822) (ros-controls#823) (cherry picked from commit 0196eeb29ad0e2c908b547f57d31a8a1ea13e869) Co-authored-by: Tony Baltovski <tony.baltovski@gmail.com>
Before, only joints were reading the initial value parameter. However, also sensors and gpios can have configured initial values.
Initialization of vectors were called, but the implementation only checked for joints. This leaves all sensor state_interfaces initialized with
NaN
, which in turn breaks other things such as UniversalRobots/Universal_Robots_ROS2_Driver#390.With the changes suggested here, also sensors and gpios get initialized with the initial values read from the URDF.
I think in conjunction it would make sense to extend the ros2_control_demos with inital values. I've used those as a simplified environment also to verify that my URDF was not the culprit here.
I am not 100% sure whether this would be the most suitable modification, as I haven't completely understood the dataflow here, but that change seemed rather obvious to me. Feel free to point me into another direction if needed.
Anyway, this should also be ported back to Galactic. Probably a direct backmerge is not possible, since the fake->mock renaming didn't happen there, but it should be easy to do nonetheless.