-
Notifications
You must be signed in to change notification settings - Fork 304
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
[CM] Remove accepting robot description using parameter and harden the behavior when getting it from topic. #1237
Conversation
…in inactive state." This reverts commit 485b25f.
…ion from parameter.
… about it in the RM.
…hrow errors when comparing URDF and exported interfaces but add warning about this.
…den by catching all exceptions until now.
d8f03ec
to
d5b1276
Compare
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.
LGTM.
I do not think that this PR needs to be splitted.
It would be nice to comment the logic of the tests.
hardware_interface/include/hardware_interface/resource_manager.hpp
Outdated
Show resolved
Hide resolved
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.
Some partial comments for now. I will review the rest later
} | ||
init_resource_manager(robot_description_); |
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.
init_resource_manager(robot_description_); | |
init_resource_manager(robot_description_); | |
init_services(); |
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.
There is a reason why I moved init_service
into callback. The idea is that they are not available until there is HW. Otherwise, it happens that the spawner fails before the controller manager manages to get the robot description and initialize HW. When services are not available, spawners are waiting for them.
I can understand that this is not logical on the first view. Maybe there is another better solution, but I wanted to avoid adding additional flags to synchronize that.
<< e.what()); | ||
"ResourceManager has already loaded an urdf file. Ignoring attempt to reload a robot " | ||
"description file."); | ||
return; |
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.
return; | |
if(!robot_description_notification_timer_->is_canceled()) | |
{ | |
robot_description_notification_timer_->cancel(); | |
} | |
return; |
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.
can this happen at all?
robot_description_notification_timer_ = create_wall_timer( | ||
std::chrono::seconds(1), | ||
[&]() | ||
{ | ||
RCLCPP_WARN( | ||
get_logger(), "Waiting for data on '~/robot_description' topic to finish initialization"); | ||
}); |
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.
robot_description_notification_timer_ = create_wall_timer( | |
std::chrono::seconds(1), | |
[&]() | |
{ | |
RCLCPP_WARN( | |
get_logger(), "Waiting for data on '~/robot_description' topic to finish initialization"); | |
}); | |
// This is needed to start the CM services when the URDF is already loaded | |
if (resource_manager_->is_urdf_already_loaded()) | |
{ | |
init_services(); | |
} | |
else | |
{ | |
robot_description_notification_timer_ = create_wall_timer( | |
std::chrono::seconds(1), | |
[&]() | |
{ | |
RCLCPP_WARN( | |
get_logger(), "Waiting for data on '~/robot_description' topic to finish initialization"); | |
}); | |
} |
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.
You are right! but I think that the solution is rather to initialize the timer before subscriber. Then we have less code and it should work in both cases.
This pull request is in conflict. Could you fix it @destogl? |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1237 +/- ##
==========================================
+ Coverage 47.53% 47.66% +0.13%
==========================================
Files 41 41
Lines 3547 3539 -8
Branches 1930 1914 -16
==========================================
+ Hits 1686 1687 +1
+ Misses 459 449 -10
- Partials 1402 1403 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Please separate into 3.
- remove robot description parameter
- interfaces validation
- remove the deprecated parameters component state after start
This pull request is in conflict. Could you fix it @destogl? |
This pull request is in conflict. Could you fix it @destogl? |
The last PR was merged yesterday, I think this can be closed. |
#1218 should go before this PR.
Should I split this into multiple PRs? There is a bit of a mix now with small code restructurings, renaming and similar.