Repository navigation
Move initialization of ServoNode into constructor - #761
Conversation
Codecov Report
@@ Coverage Diff @@
## main #761 +/- ##
==========================================
- Coverage 54.54% 54.51% -0.03%
==========================================
Files 195 196 +1
Lines 21359 21340 -19
==========================================
- Hits 11649 11631 -18
+ Misses 9710 9709 -1
Continue to review full report at Codecov.
|
henningkayser
left a comment
There was a problem hiding this comment.
I think this is some really good cleanup. Interesting, that get_node_base_interface() is really the only thing that is required, but this somewhat makes sense. Unrelated to your changes, do we really want to stick to a SingleThreadedExecutor? The collision check is running in a separate thread, but if it's blocking the executor thread (since PSM callbacks are locked) this could also interfere with in and outputs for the ServoCalcs thread. Haven't we at some point experienced weird synchronization issues were the output controls were limited to a lower frequency without an apparent reason?
|
@tylerjw Please make an issue to track the multiple concerns raised in the description:
|
Description
While reviewing the hybrid planner I was reading the source for how component nodes get created and realized that the component node class doesn't have to inherit from rclcpp::Node. If instead, you do it this way you don't need that call to
make_shared_from_thisthat can't happen in the constructor.The major advantage of that is that initialization is more straightforward as it happens in the constructor. You may ask why I didn't get rid of the start and stop interfaces then. The reason I didn't is that when I do it reveals a race condition. This has something to do with the static transform publisher needed for the virtual_joint.
I'm sorry for the lack of description for my last small change. This was what I was working on when I made it. You will notice I deleted the StartStopTest. I did that because with this simplification it was not testing anything anymore that was not tested by other tests.
This change does change the behavior in one way. That is that calling stop is actually just the same as calling pause for now. I plan on changing this in the future and removing the start/stop interfaces in favor of just the pause/unpause interfaces. That will make it much simpler for users. If it is useful that it start paused, that behavior could be accomplished without the start and stop that was deleting and re-creating a bunch of the objects and internal state.
Checklist