ms-iot / ROSOnWindows

ROS on Windows Documentation Repository
https://aka.ms/ros/docs
MIT License
213 stars 49 forks source link

Failed to loat gazebo_ros_controll.dll #70

Closed OnesoulKang closed 5 years ago

OnesoulKang commented 5 years ago

When I launch my launch file, error 'Failed to load gazbo_ros_control.dll' is occur.

There are 'gazebo_ros_control.dll' & 'gazebo_ros_control.lib' in "C:\opt\ros\melodic\x64\lib"

I confirmed that the package is in "C:/opt/ros/melodic/x64\share\gazebo_ros_contro"l using the command 'rospack find gazebo_ros_control'.

How can I fix this error?

Here is my launch file. <?xml version="1.0" encoding="UTF-8"?>

and this is my xacro file <?xml version="1.0" ?>

transmission_interface/SimpleTransmission hardware_interface/EffortJointInterface hardware_interface/EffortJointInterface 1 transmission_interface/SimpleTransmission hardware_interface/EffortJointInterface hardware_interface/EffortJointInterface 1
ooeygui commented 5 years ago

Hi @OnesoulKang, I'd like to reproduce this locally. Can you post the commands to setup a workspace? (including clone locations)

@seanyen-msft I don't recall - do we automatically remap Linux filenames to Windows? (I see a libgazebo_ros_control.so in the Xacro)

seanyen commented 5 years ago

@OnesoulKang one way to debug it is to use process monitor to watch where does the gazebo looks for the DLL.

@ooeygui yes, the Gazebo does the trick to remap the so to dll internally if it is Windows system. My guess would be search path issue.

OnesoulKang commented 5 years ago

@ooeygui I don't know much about this field, so I think it'd be nice if you could give me some more details on what I should tell you.

I usually use this commands to set my working environment. c:\opt\ros\melodic\x64\setup.bat c:\catkin_ws\devel\setup.bat

seanyen commented 5 years ago

@OnesoulKang On a second look at your launch file, can you add something like below: You can see an example here:

  <env name="GAZEBO_PLUGIN_PATH" value="$(find gazebo_plugins)"/>

Gazebo honors %GAZEBO_PLUGIN_PATH% to search the plugin DLLs.

OnesoulKang commented 5 years ago

@seanyen-msft

Thank you for your answer. but after I add the command, the same error still occurs.

The path I have identified by "rospack find gazebo_plugins" is "C:/opt/ros/melodic/x64\share\gazebo_plugins".

There are several files in the folder.

image

seanyen commented 5 years ago

@OnesoulKang hmm, can you modify my example and add C:\opt\ros\melodic\x64\lib to GAZEBO_PLUGIN_PATH:

<env name="GAZEBO_PLUGIN_PATH" value="C:\opt\ros\melodic\x64\lib"/>

In general, plugin DLL paths need to be added in GAZEBO_PLUGIN_PATH.

ooeygui commented 5 years ago

@OnesoulKang No worries. In order for me to reproduce it locally, I need to setup a catkin workspace just like yours. For example, can you send me the git setup instructions?

For example, in our UR3 docs, we have this:

c:\opt\ros\melodic\x64\setup.bat
mkdir c:\catkin_ws\src
cd c:\catkin_ws\src
git clone https://github.com/ms-iot/universal_robot -b init_windows
git clone https://github.com/ms-iot/ur_modern_driver -b init_windows
echo > universal_robot\ur_gazebo\CATKIN_IGNORE
cd c:\catkin_ws
catkin_make
c:\catkin_ws\devel\setup.bat

It would be great to get something similar for your setup.

OnesoulKang commented 5 years ago

@seanyen-msft I've tried the way you told me, but the same error still happens. There is no DLL file (gazbo_ros_control.dll) in the folder. So I copy&pasted the file from another computer(with Ubuntu 14.04, ROS Indigo). But the file still cannot be found.

Error Message [Plugin.hh:188] Failed to load plugin C:\opt\rosdeps\x64\lib\gazebo-9\plugins\gazebo_ros_control.dll: "C:\opt\rosdeps\x64\lib\gazebo-9\plugins\gazebo_ros_control.dll"

@ooeygui c:\opt\ros\melodic\x64\setup.bat mkdir c:\catkin_ws\src cd c:\catkin_ws\src and I downloaded a project from bitbucket. https://bitbucket.org/theconstructcore/my-robotic-manipulator catkin_make c:\catkin_ws\devel\setup.bat roslaunch mrm_description spawn.launch

seanyen commented 5 years ago

@OnesoulKang Thank for the information what repo you are using! Look like you are following the tutorials here?

After looking this demo, it seems to depend on simulation_gazebo, so I am assuming you are running both: roslaunch simulation_gazebo main.launch roslaunch mrm_description spawn.launch

And there are indeed Windows-specific bugs in ros_control related package, where I discovered some DLLs consumed by gazebo_ros_control.dll are not yet placed to the correct location. I made a few fixes and the next daily build should have it fixed. Can you try to do choco upgrade ros-melodic-desktop_full -y later? (I will ping this thread again once the new build is released.)

seanyen commented 5 years ago

@OnesoulKang The new build is out, please give it a try! (Run choco upgrade ros-melodic-desktop_full -y)

OnesoulKang commented 5 years ago

@seanyen-msft The error is gone! I really appreciate your help!

I think now we can close this issue!

Thanks!