Ask Your Question

Failure in building ROS2 Rolling via source

asked 2021-01-22 06:10:55 -0500

NithishkumarS gravatar image

updated 2021-01-22 08:38:58 -0500

gvdhoorn gravatar image

When the colcon starts building tf2 the following error pops up. How does one fix this issue and continue build via source?

 /home/nithish/ros2_rolling/install/geometry_msgs/include/geometry_msgs/msg/detail/vector3__traits.hpp:28:5: error: ‘value_to_yaml’ was not declared in this scope
   28 |     value_to_yaml(msg.x, out);
      |     ^~~~~~~~~~~~~
/home/nithish/ros2_rolling/install/geometry_msgs/include/geometry_msgs/msg/detail/vector3__traits.hpp:38:5: error: ‘value_to_yaml’ was not declared in this scope
   38 |     value_to_yaml(msg.y, out);
      |     ^~~~~~~~~~~~~
edit retag flag offensive close merge delete


In order to best help, we would need to know what steps you took to reach this result and what instructions you were following. Also of potential use would be the output of vcs export --exact src from your workspace to see which exact versions of ROS packages you are trying to build.

nuclearsandwich gravatar image nuclearsandwich  ( 2021-01-22 15:26:45 -0500 )edit

I can't promise this is your specific issue, but I've had that issue before when I tried building in a dirty terminal that had already sourced Foxy binaries. When I nuked that workspace's build/log/install and opened a fresh terminal I got it to work again.

stevemacenski gravatar image stevemacenski  ( 2021-01-22 16:07:53 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-04-07 03:41:46 -0500

m2-farzan gravatar image

If you have already installed a previous version of ROS (like foxy), that might be the source of the problem. It's because value_to_yaml function is introduced recently, and the compiler may prioritize the older version of ROS, resulting the 'not declared' error. To solve this, I just had to comment out source /opt/ros/foxy/setup.bash from my ~/.bashrc file and restart the terminal. Hope this helps.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-01-22 06:10:55 -0500

Seen: 321 times

Last updated: Jan 22 '21