Skip to content
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

Report sample lost events #686

Merged
merged 5 commits into from
Aug 13, 2021
Merged

Conversation

gonzodepedro
Copy link
Contributor

Description

Add report sample lost events in RViz.
Users will be able to detect situations where messages were sent by a publisher, but never arrived.

Checklist

  • If you are addressing rendering issues, please provide:
    • Images of both, broken and fixed renderings.
    • Source code to reproduce the issue, e.g. a YAML or rosbag file with a MarkerArray msg.
  • If you are changing GUI, please include screenshots showing how things looked before and after.
  • Choose the proper target branch: latest release branch, for non-ABI-breaking changes, future release branch otherwise.
    Due to the lack of active maintainers, we cannot provide support for older release branches anymore.
  • Did you change how RViz works? Added new functionality? Do not forget to update the tutorials and/or documentation on the ROS wiki
  • While waiting for someone to review your request, please consider reviewing another open pull request to support the maintainers of RViz. Refer to the RViz Wiki for reviewing guidelines.

@gonzodepedro gonzodepedro self-assigned this May 11, 2021
@jacobperron
Copy link
Member

Sorry, I almost forgot about this. I'll take a look today 👀

Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me, though I haven't been able to trigger a message lost event to see what the UI looks like... I tried modifying the QoS demos, but can't even make them report lost messages 😅 Any tips?

sub_opts.event_callbacks.message_lost_callback =
[&](rclcpp::QOSMessageLostInfo & info)
{
std::stringstream sstm;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should #include <sstream> .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
std::stringstream sstm;
std::ostringstream sstm;

@@ -206,11 +206,23 @@ class RosTopicDisplay : public _RosTopicDisplay

try {
// TODO(anhosi,wjwwood): replace with abstraction for subscriptions once available
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would keep this comment directly above L220

@@ -206,11 +206,23 @@ class RosTopicDisplay : public _RosTopicDisplay

try {
// TODO(anhosi,wjwwood): replace with abstraction for subscriptions once available
rclcpp::SubscriptionOptions sub_opts;
sub_opts.event_callbacks.message_lost_callback =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to guard against RMWs that don't support sample lost events?

@ivanpauno
Copy link
Member

I tried modifying the QoS demos, but can't even make them report lost messages

It was easier to get notifications with rmw_connext_cpp AFAIR.
I guess that still applies to rmw_connextdds

sub_opts.event_callbacks.message_lost_callback =
[&](rclcpp::QOSMessageLostInfo & info)
{
std::stringstream sstm;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
std::stringstream sstm;
std::ostringstream sstm;

@jacobperron
Copy link
Member

LGTM, looks like Ivan's comments about using std::ostringstream instead of std::stringstream can still be applied though.

Gonzalo de Pedro added 4 commits August 9, 2021 11:10
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
@gonzodepedro
Copy link
Contributor Author

I think it is applied here:


Am I missing some other place where it should be applied?

@gonzodepedro gonzodepedro force-pushed the gonzodepedro/report-sample-lost branch from bc9dc5b to 4f577fd Compare August 9, 2021 14:28
Copy link
Member

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all of these lines can be change to use std::ostringstream.

sub_opts.event_callbacks.message_lost_callback =
[&](rclcpp::QOSMessageLostInfo & info)
{
std::stringstream sstm;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::stringstream sstm;
std::ostringstream sstm;

sub_opts.event_callbacks.message_lost_callback =
[&](rclcpp::QOSMessageLostInfo & info)
{
std::stringstream sstm;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::stringstream sstm;
std::ostringstream sstm;

sub_opts.event_callbacks.message_lost_callback =
[&](rclcpp::QOSMessageLostInfo & info)
{
std::stringstream sstm;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::stringstream sstm;
std::ostringstream sstm;

Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
@gonzodepedro
Copy link
Contributor Author

CI build: --packages-up-to rviz2

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@gonzodepedro gonzodepedro merged commit 60a7269 into ros2 Aug 13, 2021
@jacobperron jacobperron deleted the gonzodepedro/report-sample-lost branch August 25, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants