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

Issue with compling drake-ros using colcon in Ubuntu 22.04 #376

Open
phanikiran1169 opened this issue Jan 24, 2025 · 1 comment
Open

Issue with compling drake-ros using colcon in Ubuntu 22.04 #376

phanikiran1169 opened this issue Jan 24, 2025 · 1 comment

Comments

@phanikiran1169
Copy link

Hello,

I am facing issues while building drake_ros (main branch) using colcon

Details

OS: Ubuntu LTS 22.04 LTS
ROS Distribution: Iron
Drake (installed via APT): drake-dev 1.37.0-1

Error Log

Starting >>> drake_ros
Finished <<< drake_ros [28.5s]                       
Starting >>> drake_ros_examples
--- stderr: drake_ros_examples                              
/home/sirhawk/ws_temp/src/drake-ros/drake_ros_examples/examples/multirobot/multirobot.cc: In function ‘int main(int, char**)’:
/home/sirhawk/ws_temp/src/drake-ros/drake_ros_examples/examples/multirobot/multirobot.cc:47:16: error: ‘struct drake::multibody::MultibodyPlantConfig’ has no member named ‘discrete_contact_solver’
   47 |   plant_config.discrete_contact_solver = "sap";
      |                ^~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [examples/multirobot/CMakeFiles/multirobot.dir/build.make:76: examples/multirobot/CMakeFiles/multirobot.dir/multirobot.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:258: examples/multirobot/CMakeFiles/multirobot.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< drake_ros_examples [7.38s, exited with code 2]

Temporary Fix

I have made the following changes in drake-ros/drake_ros_examples/examples/multirobot/multirobot.cc and drake-ros/drake_ros_examples/examples/multirobot/multirobot.py

   // Add a multibody plant and a scene graph to hold the robots
   drake::multibody::MultibodyPlantConfig plant_config;
   plant_config.time_step = 0.001;
-  plant_config.discrete_contact_solver = "sap";
+  // plant_config.discrete_contact_solver = "sap";
   auto [plant, scene_graph] =
       drake::multibody::AddMultibodyPlant(plant_config, &builder);
     # Add a multibody plant and a scene graph to hold the robots
     plant, scene_graph = AddMultibodyPlant(
-        MultibodyPlantConfig(time_step=0.001, discrete_contact_solver="sap"),
+        MultibodyPlantConfig(time_step=0.001),
         builder,
     )

Kindly let me know if the above fix is correct

@IanTheEngineer
Copy link
Member

@phanikiran1169, thank you for posting this issue. Your assessment is correct. drake-ros is not yet compatible with Drake version 1.37.0. We'll work to rectify that in #377, but the temporary fix you outlined is a valid solution to allow your workspace to build with the colcon tool. We were using a deprecated flag to designate SAP as the discrete contact solver but that has since become the default solver.

IanTheEngineer added a commit to IanTheEngineer/drake-ros that referenced this issue Jan 27, 2025
IanTheEngineer added a commit that referenced this issue Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants