ros-controls / gazebo_ros2_control

Wrappers, tools and additional API's for using ros2_control with Gazebo Classic
Apache License 2.0
198 stars 125 forks source link

ERROR: "struct hardware_interface::HardwareInfo’} has no member named ‘hardware_plugin_name" #247

Closed xardarii closed 9 months ago

xardarii commented 9 months ago

Hello! I am new to this and I have been trying to import my robotic arm into gazebo and then in turn into moveit. When I copied this folder into my workspace, it won't build using colcon build command. All the other packages build successfully.

Am I missing something or am I doing it wrong?

Here is what it shows in the terminal:

/home/xardarii/finalyeararm/src/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp: In member function ‘virtual void gazebo_ros2_control::GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr, sdf::v9::ElementPtr)’: /home/xardarii/finalyeararm/src/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp:290:67: error: ‘__gnu_cxx::__alloc_traits<std::allocator, hardware_interface::HardwareInfo>::value_type’ {aka ‘struct hardware_interface::HardwareInfo’} has no member named ‘hardware_plugin_name’ 290 | d::string robot_hw_sim_typestr = control_hardware_info[i].hardware_plugin_name; | ^~~~~~~~

gmake[2]: [CMakeFiles/gazebo_ros2_control.dir/build.make:76: CMakeFiles/gazebo_ros2_control.dir/src/gazebo_ros2_control_plugin.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:139: CMakeFiles/gazebo_ros2_control.dir/all] Error 2 gmake[1]: Waiting for unfinished jobs.... gmake: [Makefile:146: all] Error 2

Failed <<< gazebo_ros2_control [2min 5s, exited with code 2]

Summary: 1 package finished [2min 11s] 1 package failed: gazebo_ros2_control 1 package had stderr output: gazebo_ros2_control

ahcorde commented 9 months ago

which Gazebo and ROS version are you using ? did you checkout the right gazebo_ros2_control branch ?

xardarii commented 9 months ago

@ahcorde I am using ROS2 Humble with Gazebo 11.10.2 version 11.10.2. I believe I did, I am not sure.

ahcorde commented 9 months ago

did you checkout humble in your local https://github.com/ros-controls/gazebo_ros2_control/ repository?

bmagyar commented 9 months ago

Have you tried installing it from the package manager instead?

xardarii commented 9 months ago

did you checkout humble in your local https://github.com/ros-controls/gazebo_ros2_control/ repository? @ahcorde okay idk how but it just worked now, I cloned the humble branch of the repository but it didn't work in the first try (I prolly messed up) but it worked when I cloned it again.

Thankyou sm :)) i am closing it this issue. ^_^