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

add QoS Profile/Depth support to Node. #1376

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

fujitatomoya
Copy link
Collaborator

closes #1368

Comment on lines +240 to +243
:param rosout_qos_profile: A QoSProfile or a history depth to apply to rosout publisher.
In the case that a history depth is provided, the QoS history is set to KEEP_LAST,
the QoS history depth is set to the value of the parameter,
and all other QoS settings are set to their default values.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

One concern: changing QoS for rosout publisher would generate incompatible QoS setting with concerned subscribers. this possibly break the ROS 2 user application, this will not happen in downstream users, but we would want to add more comment for this?

@fujitatomoya
Copy link
Collaborator Author

@ahcorde @clalancette please take a look if you have time.

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Tomoya Fujita <[email protected]>
@fujitatomoya
Copy link
Collaborator Author

Pulls: #1376
Gist: https://gist.githubusercontent.com/fujitatomoya/2288c082a6b12e1b69cb9fa1878b9ffc/raw/a5f536d8bd4673a5e2b08457b15bffc4b3d52e55/ros2.repos
BUILD args: --packages-above-and-dependencies rclpy
TEST args: --packages-above rclpy
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/14780

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Comment on lines +86 to +107
def test_create_node_disable_rosout(self):
node_name = 'create_node_test_disable_rosout'
namespace = '/ns'
node = rclpy.create_node(
node_name, namespace=namespace, context=self.context, enable_rosout=False)
node.destroy_node()

def test_create_node_rosout_qos_profile(self):
node_name = 'create_node_test_rosout_rosout_qos_profile'
namespace = '/ns'
node = rclpy.create_node(
node_name, namespace=namespace, context=self.context, enable_rosout=True,
rosout_qos_profile=qos_profile_sensor_data)
node.destroy_node()

def test_create_node_rosout_qos_depth(self):
node_name = 'create_node_test_rosout_rosout_qos_depth'
namespace = '/ns'
node = rclpy.create_node(
node_name, namespace=namespace, context=self.context, enable_rosout=True,
rosout_qos_profile=10)
node.destroy_node()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a huge fan of tests that don't assert anything. I guess these do test that this isn't throwing an exception, but they aren't testing that what we asked for actually happened. Could we assert that rosout exists (or doesn't exist), and that it has the QoS profile we provided?

@@ -214,6 +217,7 @@ def create_node(
namespace: Optional[str] = None,
use_global_arguments: bool = True,
enable_rosout: bool = True,
rosout_qos_profile: Optional[Union[QoSProfile, int]] = qos_profile_system_default,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the correct "default" profile for the rosout publisher. As far as I can tell, the default here is actually https://github.com/ros2/rcl/blob/d9daca7c0af7ecdcd103ece30bb7c64bc919ef24/rcl/include/rcl/logging_rosout.h#L37-L48 . So I think we should define this to be the same by default.

@fujitatomoya
Copy link
Collaborator Author

@clalancette thanks for the review and information. i agree with your comments, i will try to address them.

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.

No way to set rosout QoS for a Node
3 participants