Skip to content

Printing the entire message as String #69

Closed

Description

@anasarrak

Is there any way to print the entire message as String as ROS does with stringstream?
Example:

std_msgs::msg::String msg;
std::stringstream ss;
ss << msg;
RCLCPP_INFO(node->get_logger(), "%s\n",ss.str().c_str());

Activity

  1. added
    duplicate
    on Jun 13, 2019
  2. dirk-thomas commented on Jun 13, 2019

    @dirk-thomas
    Member

    Atm there are no streaming operator defined for message. There is a ticket to add various to-string functions though: ros2/rosidl#259

    Therefore I will close this ticket as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions