ROBOTIS-GIT / turtlebot3_simulations

Simulations for TurtleBot3
http://turtlebot3.robotis.com/
Apache License 2.0
329 stars 434 forks source link

Add default values when declaring parameters. Fixes build error on Ub… #151

Closed tdenewiler closed 3 years ago

tdenewiler commented 3 years ago

…untu 20.04/ROS2 Foxy.

tdenewiler commented 3 years ago

My environment:

I ran into build errors this morning after merging in the latest from the ros2 branch. To re-create:

mkdir -p turtlebot3_simulations/src
cd turtlebot3_simulations/src
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
git checkout ros2
cd ../..
. /opt/ros/foxy/setup.bash
colcon build --symlink-install

In the target branch there are build errors of the form

--- stderr: turtlebot3_fake_node                                                                              
/home/user/turtlebot3_simulations/src/turtlebot3_simulations/turtlebot3_fake_node/src/turtlebot3_fake_node.cpp: In member function ‘void Turtlebot3Fake::init_parameters()’:
/home/user/turtlebot3_simulations/src/turtlebot3_simulations/turtlebot3_fake_node/src/turtlebot3_fake_node.cpp:75:60: error: no matching function for call to ‘Turtlebot3Fake::declare_parameter<std::string>(const char [19])’
   75 |   this->declare_parameter<std::string>("joint_states_frame");

In the source branch (from fork) those build errors do not happen.

tdenewiler commented 3 years ago

@ruffsl, the error I am seeing was introduced in 6d48b40c15a39918fb1899027726a173d3c83f6f. Are you seeing this build error? Do the changes in this PR still satisfy moving away from deprecated uses of declare_parameter?

ruffsl commented 3 years ago

I think the ros2 branch here tracks the master brach from ros/ros2. Looks like you might want to target the foxy branch of you'd like to build from foxy binaries.

tdenewiler commented 3 years ago

I do not get build errors with the foxy-devel branch. Thanks.