added dt to controller interface and controller manager #438#520
added dt to controller interface and controller manager #438#520bmagyar merged 10 commits intoros-controls:masterfrom
Conversation
controller_manager/test/test_controller_failed_init/test_controller_failed_init.hpp
Outdated
Show resolved
Hide resolved
destogl
left a comment
There was a problem hiding this comment.
This looks good. The only question I have is how do we want to proceed. Should we provide dt or absolute current time? Anyway, IMO, we should provide read measured time since the last update call and not theoretical one. What do you think?
I didn't see the discussion when I started, so I went with What I'm not sure about is what would be the source of the absolute time, would it come from ros, or something like Either way, I'm happy to try and implement the change if you'd like to proceed with absolute current time.
I went ahead and implemented the above two for now. Please let me know if it's better to go with absolute current time instead. |
Co-authored-by: Denis Štogl <destogl@users.noreply.github.com>
|
update functions in |
destogl
left a comment
There was a problem hiding this comment.
Generally I agree, just few points to discuss.
Also, do we need a test for this functionality? A simple one testing parameter propagation?
| void ControllerManager::read() { resource_manager_->read(); } | ||
|
|
||
| controller_interface::return_type ControllerManager::update() | ||
| controller_interface::return_type ControllerManager::update(const rclcpp::Time& time, const rclcpp::Duration& period) |
There was a problem hiding this comment.
Maybe we should provide only time in this method and period is calculated just before controller-update is called. What do you think?
There was a problem hiding this comment.
Would that still work with node->now() from your comment below to get a good dt or do you think it's ok to add a couple of variables there to track dt using steady_clock?
There was a problem hiding this comment.
@destogl the purpose of this API is to provide both as both should be available from the CM time without having to re-compute the same stuff all the time.
|
@destogl in terms of a test for this... I don't think we need one at this point. The main point of this PR is to extend the API which was achieved. Testing that is testing that C++ can propagate arguments to a function :D I don't think we need that |
destogl
left a comment
There was a problem hiding this comment.
Thanks for the work and follow-up to getting this PR straight! 🤖
I took a stab at adding #438. This is by no means complete, but if no one has started work on this, I'd like to get some feedback and I can keep working on it.