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

RCLCPP_INFO error with string concatenation #14

Open
simojo opened this issue Oct 11, 2023 · 0 comments · May be fixed by #15
Open

RCLCPP_INFO error with string concatenation #14

simojo opened this issue Oct 11, 2023 · 0 comments · May be fixed by #15

Comments

@simojo
Copy link

simojo commented Oct 11, 2023

Description

After a fresh clone, running colcon build produces the following output when it tries to build clover_ros2:

Starting >>> led_msgs
Starting >>> clover_ros2_msgs
Starting >>> vl53l1x
Finished <<< vl53l1x [0.70s]
Finished <<< led_msgs [0.82s]
Finished <<< clover_ros2_msgs [0.85s]
Starting >>> ws281x
Starting >>> led_msgs_test

...

Finished <<< ws281x [0.55s]
Starting >>> clover_ros2
Starting >>> ws281x_test

...

Finished <<< led_msgs_test [0.84s]

...

Finished <<< ws281x_test [0.72s]

...

/_scratch/clover_ros2_pkgs/clover_ros2/src/led.cpp: In member function ‘void CloverLEDController::proceed()’:
/_scratch/clover_ros2_pkgs/clover_ros2/src/led.cpp:319:95: error: cannot convert ‘std::__cxx11::basic_string<char>’ to ‘const char*’
  319 |                 RCLCPP_INFO(this->get_logger(), "Effect change detected, changing effect to " + effect->to_string());
      |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                                                                                               |
      |                                                                                               std::__cxx11::basic_string<char>

...

Failed   <<< clover_ros2 [4.00s, exited with code 2]

Summary: 6 packages finished [6.03s]
  1 package failed: clover_ros2
  3 packages had stderr output: clover_ros2 led_msgs_test ws281x_test

This suggests to me that you can't concatenate the two different string types with +.

Either I have my system improperly set up, or this will need changed. I'll submit my PR to fix this regardless, just in case it ends up being helpful. Let me know if I should provide any more info, thanks.

System information

-- --
OS Ubuntu 22.044.3 LX x86_64
ROS version ROS2 (rolling)
@simojo simojo linked a pull request Oct 11, 2023 that will close this issue
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 a pull request may close this issue.

1 participant