Closed yigitboracagiran closed 4 months ago
I think it's trying to build with noetic and it causes the problem. But in my .bashrc file I sourced foxy, not noetic.
I deleted my install, build and log folders. Then I builded it with colcon build and it worked.
--- stderr: neuronbot2_bringup > TransformStamped;
| ^]’:
/home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp:82:75: required from here
/usr/include/c++/9/bits/unique_ptr.h:857:30: error: no matching function for call to ‘tf2_ros::TransformBroadcaster::TransformBroadcaster(neuronbot2::NeuronSerial)’
857 | { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
| ^
/home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp: In member function ‘void neuronbot2::NeuronSerial::update_odom()’: /home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp:227:29: error: ‘TransformStamped’ is not a member of ‘geometry_msgs::msg’; did you mean ‘geometry_msgs::TransformStamped’? 227 | geometry_msgs::msg::TransformStamped odom_tf; | ^
~~~In file included from /opt/ros/noetic/include/tf2/convert.h:38, from /opt/ros/noetic/include/tf2_geometry_msgs/tf2_geometry_msgs.h:35, from /home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/include/neuronbot2_bringup/neuron_serial.hpp:31, from /home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp:20: /opt/ros/noetic/include/geometry_msgs/TransformStamped.h:60:67: note: ‘geometry_msgs::TransformStamped’ declared here 60 | typedef ::geometrymsgs::TransformStamped<std::allocator~~~/home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp:228:9: error: ‘odom_tf’ was not declared in this scope; did you mean ‘odom’? 228 | odom_tf.header.stamp = now; | ^~~ | odom In file included from /usr/include/c++/9/bits/locale_conv.h:41, from /usr/include/c++/9/locale:43, from /usr/include/c++/9/iomanip:43, from /home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp:17: /usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::single_object std::make_unique(_Args&& ...) [with _Tp = tf2_ros::TransformBroadcaster; _Args = {neuronbot2::NeuronSerial*}; typename std::_MakeUniq<_Tp>::single_object = std::unique_ptr~~~~~~~~~~ In file included from /home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/include/neuronbot2_bringup/neuron_serial.hpp:32, from /home/otobot/yigit_ws/src/neuronbot2/neuronbot2_bringup/src/neuron_serial.cpp:20: /opt/ros/noetic/include/tf2_ros/transform_broadcaster.h:51:3: note: candidate: ‘tf2_ros::TransformBroadcaster::TransformBroadcaster()’ 51 | TransformBroadcaster(); | ^~~~~~~~ /opt/ros/noetic/include/tf2_ros/transform_broadcaster.h:51:3: note: candidate expects 0 arguments, 1 provided /opt/ros/noetic/include/tf2_ros/transform_broadcaster.h:48:7: note: candidate: ‘tf2_ros::TransformBroadcaster::TransformBroadcaster(const tf2_ros::TransformBroadcaster&)’ 48 | class TransformBroadcaster{ | ^~~~~~~~ /opt/ros/noetic/include/tf2_ros/transform_broadcaster.h:48:7: note: no known conversion for argument 1 from ‘neuronbot2::NeuronSerial’ to ‘const tf2_ros::TransformBroadcaster&’ /opt/ros/noetic/include/tf2_ros/transform_broadcaster.h:48:7: note: candidate: ‘tf2_ros::TransformBroadcaster::TransformBroadcaster(tf2_ros::TransformBroadcaster&&)’ /opt/ros/noetic/include/tf2_ros/transform_broadcaster.h:48:7: note: no known conversion for argument 1 from ‘neuronbot2::NeuronSerial*’ to ‘tf2_ros::TransformBroadcaster&&’ make[2]: [CMakeFiles/neuronbot2_driver.dir/build.make:89: CMakeFiles/neuronbot2_driver.dir/src/neuron_serial.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:78: CMakeFiles/neuronbot2_driver.dir/all] Error 2 make: *** [Makefile:141: all] Error 2Failed <<< neuronbot2_bringup [2.86s, exited with code 2]