Gazebo | Ignition | Community
Ask Your Question
0

ROS2 subscriber node in a gazebo plugin ERROR

asked 2020-02-22 12:11:10 -0500

abed gravatar image

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-02-22 15:09:18 -0500

abed gravatar image

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

edit flag offensive delete link more
0

answered 2020-02-22 12:52:04 -0500

chapulina gravatar image

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-02-22 12:11:10 -0500

Seen: 180 times

Last updated: Feb 22 '20