Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build gz_ros2_control for humble+harmonic #394

Closed
Witty-Wizard opened this issue Aug 23, 2024 · 11 comments
Closed

Build gz_ros2_control for humble+harmonic #394

Witty-Wizard opened this issue Aug 23, 2024 · 11 comments
Labels
wontfix This will not be worked on

Comments

@Witty-Wizard
Copy link

System Config:

ROS Distro : Humble
Gazebo Version: Harmonic
Linux Version: Ubuntu Jammy (Running Inside Docker)

Help Needed:

I need help on how to install and setup gz_ros2_control plugin on ROS Humble with Gazebo Harmonic.

While Compiling from source I get the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
gz_ros2_control: Cannot locate rosdep definition for [gz_plugin_vendor]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully
@christophfroehlich
Copy link
Contributor

Have you read the compatibility table in the readme? This combination is not officially supported.
For humble distro you have to use the humble branch, because the *_vendor packages are not released for distros older than jazzy. But this might not work with harmonic, you can try to use the iron branch.

@Witty-Wizard
Copy link
Author

Have you read the compatibility table in the readme? This combination is not officially supported. For humble distro you have to use the humble branch, because the *_vendor packages are not released for distros older than jazzy. But this might not work with harmonic, you can try to use the iron branch.

I have read the documentation, but I want to run harmonic with humble.

@christophfroehlich
Copy link
Contributor

Have you tried humble or iron branch as suggested?

@Witty-Wizard
Copy link
Author

I did try those branches, there is get dependency error

@christophfroehlich christophfroehlich changed the title [HELP]: How to build binaries for gz_ros2_control Build gz_ros2_control for humble+harmonic Aug 23, 2024
@christophfroehlich christophfroehlich added the wontfix This will not be worked on label Aug 23, 2024
@christophfroehlich
Copy link
Contributor

Sorry, this is just not supported. What you can try is to compile the iron version of the whole ros2_control stack, this could work on humble distro but without guarantee to be stable.

@Witty-Wizard
Copy link
Author

I tried building using the iron branch, I got the Following error:

Starting >>> gz_ros2_control
--- stderr: gz_ros2_control                             
/home/jazzer/gz_ros2_control_ws/src/gz_ros2_control/gz_ros2_control/src/gz_ros2_control_plugin.cpp: In member function ‘virtual void gz_ros2_control::GazeboSimROS2ControlPlugin::Configure(const Entity&, const std::shared_ptr<const sdf::v14::Element>&, gz::sim::v8::EntityComponentManager&, gz::sim::v8::EventManager&)’:
/home/jazzer/gz_ros2_control_ws/src/gz_ros2_control/gz_ros2_control/src/gz_ros2_control_plugin.cpp:428:67: error: ‘__gnu_cxx::__alloc_traits<std::allocator<hardware_interface::HardwareInfo>, hardware_interface::HardwareInfo>::value_type’ {aka ‘struct hardware_interface::HardwareInfo’} has no member named ‘hardware_plugin_name’
  428 |     std::string robot_hw_sim_type_str_ = control_hardware_info[i].hardware_plugin_name;
      |                                                                   ^~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/gz_ros2_control-system.dir/build.make:76: CMakeFiles/gz_ros2_control-system.dir/src/gz_ros2_control_plugin.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/gz_ros2_control-system.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2

This might be fixable with some tweaking in the source code.
I will try and update it here.

@Witty-Wizard
Copy link
Author

I tried building using the iron branch, I got the Following error:

Starting >>> gz_ros2_control
--- stderr: gz_ros2_control                             
/home/jazzer/gz_ros2_control_ws/src/gz_ros2_control/gz_ros2_control/src/gz_ros2_control_plugin.cpp: In member function ‘virtual void gz_ros2_control::GazeboSimROS2ControlPlugin::Configure(const Entity&, const std::shared_ptr<const sdf::v14::Element>&, gz::sim::v8::EntityComponentManager&, gz::sim::v8::EventManager&)’:
/home/jazzer/gz_ros2_control_ws/src/gz_ros2_control/gz_ros2_control/src/gz_ros2_control_plugin.cpp:428:67: error: ‘__gnu_cxx::__alloc_traits<std::allocator<hardware_interface::HardwareInfo>, hardware_interface::HardwareInfo>::value_type’ {aka ‘struct hardware_interface::HardwareInfo’} has no member named ‘hardware_plugin_name’
  428 |     std::string robot_hw_sim_type_str_ = control_hardware_info[i].hardware_plugin_name;
      |                                                                   ^~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/gz_ros2_control-system.dir/build.make:76: CMakeFiles/gz_ros2_control-system.dir/src/gz_ros2_control_plugin.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:139: CMakeFiles/gz_ros2_control-system.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2

This might be fixable with some tweaking in the source code. I will try and update it here.

I Did It!!!

changing hardware_plugin_name to hardware_class_type in the gz_ros2_control_plugin.cpp file did the trick.
This works because hardware_plugin_name has been changed to hardware_class_type for ros humble.

I will create a new branch in my fork called humble-harmonic.

@christophfroehlich
Copy link
Contributor

fyi, there is a similar fork for humble+garden: #268

It might have been possible to also compile iron version of ros2_control+controllers from source instead of changing the variable, for example with this repos file.

@Witty-Wizard
Copy link
Author

Witty-Wizard commented Aug 24, 2024

fyi, there is a similar fork for humble+garden: #268

It might have been possible to also compile iron version of ros2_control+controllers from source instead of changing the variable, for example with this repos file.

That is the idea, I am trying to understand the CI process so that I can publish a branch, and make it available through apt, this way I can use it in my docker image.
Can you direct to some resource on how can i share the binaries so that they don't need to be build every time

@christophfroehlich
Copy link
Contributor

THB I don't think that this is worth it.
But if you want to fork this repo you could release it as independent package on the ROS buildfarm. Or you use github to build the debian and release it.

@Witty-Wizard
Copy link
Author

THB I don't think that this is worth it.

But if you want to fork this repo you could release it as independent package on the ROS buildfarm. Or you use github to build the debian and release it.

Thanks! I will do that and update here.
Till then I am closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants