Robotics StackExchange | Archived questions

ROS2 subscriber node in a gazebo plugin ERROR

Hello Guys,

I have created a Lidar sensor in Gazebo. Inside the plugin, I have created a ROS2 subscriber node to set the velocity of a rotational joint through a float32 messages.But I am getting the following error after inserting the sensor in the gazebo world.

image description

I am using Gazebo 9 and ROS2 eloquent and here is my .cc file

image description

And here is my CMakeLists.txt file

image description

I have been stuck on this error for a while, so i really appreciate any help.

Asked by abed on 2020-02-22 13:11:10 UTC

Comments

Answers

Can you try using ament_target_dependencies instead of target_link_libraries? See how the gazebo_plugins package is doing it.

I'd also suggest you use a gazebo_ros::Node instead of rclcpp::Node, see this example.

Asked by chapulina on 2020-02-22 13:52:04 UTC

Comments

Thank you Louise for your answer. I went over your suggested link and i have modified my CMakeLists.txt file so it became like this:

image description

But now i'm getting this error

image description

Asked by abed on 2020-02-22 16:09:18 UTC

Comments