-
Notifications
You must be signed in to change notification settings - Fork 112
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
fuse -> ROS 2 fuse_publishers: Port fuse_publishers #299
fuse -> ROS 2 fuse_publishers: Port fuse_publishers #299
Conversation
96bfbd8
to
d95e745
Compare
d95e745
to
cb6b42e
Compare
@ros-pull-request-builder run tests please! |
3e45013
to
f9d587a
Compare
@ros-pull-request-builder run tests please! Only instabilities are linters! |
f9d587a
to
6ee89e8
Compare
* @param[in] name A unique name to give this plugin instance | ||
* @param[in] name The number of threads to use with this publisher |
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.
Nit, remove this line
fuse_core/src/async_publisher.cpp
Outdated
void AsyncPublisher::initialize(const std::string & name) | ||
void AsyncPublisher::initialize( | ||
node_interfaces::NodeInterfaces< | ||
node_interfaces::Base, |
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.
Nit, I think this could use ALL_RCLCPP_NODE_INTERFACES
macro. The macro says fuse_core::...
, but I think that will still work inside the fuse_core
namespace.
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.
Ah I missed this one
@@ -45,7 +45,7 @@ class MyPublisher : public fuse_core::AsyncPublisher | |||
{ | |||
public: | |||
MyPublisher() | |||
: fuse_core::AsyncPublisher(0), | |||
: fuse_core::AsyncPublisher(), |
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.
nit, 1
to match the ROS 1 test:
fuse_core::AsyncPublisher(1), |
std::string base_frame_; //!< The name of the robot's base_link frame | ||
fuse_core::UUID device_id_; //!< The UUID of the device to be published | ||
rclcpp::Clock::SharedPtr clock_; //!< The publisher's clock, for timestamping and logging | ||
rclcpp::Logger logger_; //!< The publisher's logger, shared_ptr for deferred init |
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.
nit, update comment to remove shared_ptr
|
||
// Send the graph to the Publisher to trigger message publishing | ||
publisher.notify(transaction_, graph_); | ||
|
||
// Verify the subscriber received the expected pose | ||
rclcpp::Time timeout = node_->now() + rclcpp::Duration::from_seconds(10.0); | ||
while ((!received_pose_msg_) && (node_->now() < timeout)) | ||
rclcpp::Time timeout = node->now() + rclcpp::Duration::from_seconds(20.0); |
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.
why was the timeout increased from 10s to 20s?
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.
I found that it sometimes times out if left at 10 seconds, same with the ones below
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.
Interesting! I wonder if the timeout was happening because of the extra 5 second sleep that was removed #299 (comment)
I changed the timeouts back to 10 seconds and didn't see any failures in 100 runs using:
colcon test --event-handlers console_direct+ --packages-select fuse_publishers --ctest-args -R _2d_publisher --retest-until-fail 100
|
||
// Send the graph to the Publisher to trigger message publishing | ||
publisher.notify(transaction_, graph_); | ||
|
||
// Verify the subscriber received the expected pose | ||
rclcpp::Time timeout = node_->now() + rclcpp::Duration::from_seconds(10.0); | ||
while ((!received_pose_with_covariance_msg_) && (node_->now() < timeout)) | ||
rclcpp::Time timeout = node->now() + rclcpp::Duration::from_seconds(20.0); |
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.
same question about the timeout increase
// Send the graph to the Publisher to trigger message publishing | ||
publisher.notify(transaction_, graph_); | ||
|
||
// Verify the subscriber received the expected pose | ||
rclcpp::Time timeout = node_->now() + rclcpp::Duration::from_seconds(10.0); | ||
while ((!received_tf_msg_) && (node_->now() < timeout)) | ||
rclcpp::Time timeout = node->now() + rclcpp::Duration::from_seconds(20.0); |
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.
same question about the timeout increase
2f0e84d
to
14c26a6
Compare
dd4875f
to
0a890d4
Compare
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>
0a890d4
to
1ee1885
Compare
See: #276
Description
This PR ports the entirety of fuse_publishers, including:
Notably, the AsyncPublisher class in fuse_core was updated (together with its tests)
I also changed the signature of its constructor to make use of
initialize
to set executor threads as well as pass it the appropriate NodeInterfaces.In order to avoid specifying all manner of node interfaces in the AsyncPublisher class, I made it so that the derived publisher classes shadow their internal interface variable (and also call the parent's initialize method).
TODOs were left in downstream packages (models and tutorials) to update the usage of AsyncPublisher just like how it was done in fuse_publishers.
Furthermore, there's a missing signature in
tf2_ros::Buffer
that allows for buffer construction with node-like types. I left a TODO. I don't think it's too important, since it's only for logging/debugging with service calls.Also, I realized I could just declare parameters instead of loading them in via yaml files, so I changed around some of the tests to reflect that...
Notes
Pinging @svwilliams for visibility.