gazebo_ros_control plugin: GazeboRosControlPlugin missing <legacyModeNS> DefaultRobotHWSim
I upgraded my Linux box from Ubuntu 17.04 to 18.04 (x64) and upgraded ROS lunar to melodic. Now, when I run my launch file I get the following error:
[ERROR] [1527494740.144219702, 307.635000000]: GazeboRosControlPlugin missing <legacyModeNS> while using DefaultRobotHWSim, defaults to true.
This setting assumes you have an old package with an old implementation of DefaultRobotHWSim, where the robotNamespace is disregarded and absolute paths are used instead.
If you do not want to fix this issue in an old package just set <legacyModeNS> to true.
I am not sure what this error message is telling me. Let me sum what I think I know:
- The
gazebo_ros_control
plugin is a gazebo plugin providing an interface to control a robot in gazebo from ros. (so maybe this is not the right place to ask this question) - I am not sure which setting assumes that I am using an old implementation of
DefaultRobotHWSim
, butDefaultRobotHWSim
is part of the ubuntu packageros-melodic-gazebo-ros-control
. The following package is currently installed on my system:ros-melodic-gazebo-ros-control/bionic,now 2.8.2-0bionic.20180522.164152 amd64 [installed,automatic]
So according to the error message I have two options here:
- Fix this issue in an old package or
- set
<legacyModeNS>
totrue
For 1. I am not sure what AN OLD PACKAGE refers to, one of my packages or the gazebo_ros_control
plugin package and for 2. I am not sure where to set <legacyModeNS>
to true
.
I have another error where my publisher is stopping to publish control messages once I set a new set point, but I thought I fix the most obvious error first.
Asked by bas on 2018-05-28 03:51:44 UTC
Answers
Reading the source code in gazebo_ros_control_plugin.cpp
for melodic and lunar (http://docs.ros.org/melodic/api/gazebo_ros_control/html/gazebo_roscontrol_plugin_8cpp_source.html) this error message must have made its appearance already in lunar. I must have missed it.
So, for
- this would mean fixing the gazebo_ros_control plugin (as far as I understand)
<legacyModeNS>
goes into the.gazebo
file accompanying the.urdf
ord.xacro
file<gazebo> <static>false</static> <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> <robotNamespace>/mugator_manip</robotNamespace> <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType> <legacyModeNS>true</legacyModeNS> </plugin> </gazebo>
Asked by bas on 2018-05-28 04:39:27 UTC
Comments
thanks, it can solve the question.
Asked by Yanqingyang on 2019-03-19 01:01:30 UTC
Solved mine too
Asked by Reshmon on 2019-05-06 03:24:10 UTC
What do you mean by "fixing the gazebo_ros_control plugin"? I have kinetic
on Ubuntu 16.04 ang having the same problem even though I have gazebo-ros-control
installed. How do I fix this?
Asked by teshansj on 2019-09-17 23:00:35 UTC
I also have Kinetic on Ubuntu 16.04, and I added the line
Asked by petitpoulet on 2019-10-02 09:42:53 UTC
Where can I find the file where I can update legacyModeNS ?
Asked by oovidiustr on 2019-10-18 10:10:21 UTC
below command should retrieve the path of the file where the changes need to be done.
grep robotSimType -R /home/my_name/catkin_ws
Replace the path in above command with your catkin workspace directory
Asked by sujideevi on 2020-02-03 22:00:07 UTC
where is file?I cant find it.
Asked by moyu on 2020-03-27 04:34:55 UTC
where to find the file? the .gazebo file i mean
Asked by mohan_pannirselvam on 2020-05-05 15:48:27 UTC
you must add this command to find the file..
grep robotSimType -R /home/your_name/your_workspace_name
Then cd tp the location.Like my case:
cd /home/mohan/rosurtutorial/src/universal_robot/ur_description/urdf
there you will find the file called common gazebo.xacro
then
gedit common.gazebo.xacro
then copy paste the above code.
thrn go bak to yor workspace root folder and add this command:
catkin_make
Asked by mohan_pannirselvam on 2020-05-05 15:57:39 UTC
@petitpoulet where did you find the file mentioned
Asked by Giri on 2020-07-04 10:28:19 UTC
Hi. Can someone explain what
Asked by thejose on 2020-08-21 11:52:41 UTC
this change does not have an effect. The same error appears again using ros-kinetic.
Asked by Michdo93 on 2021-11-28 07:19:18 UTC
Go to ur_discription/urdf/commom.gazebo.xacro and modify the file by as follows
<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro">
<gazebo>
<plugin name="ros_control" filename="libgazebo_ros_control.so">
<!--robotNamespace>/</robotNamespace-->
<!--robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType-->
<legacyModeNS>true</legacyModeNS>
</plugin>
<!--
<plugin name="gazebo_ros_power_monitor_controller" filename="libgazebo_ros_power_monitor.so">
<alwaysOn>true</alwaysOn>
<updateRate>1.0</updateRate>
<timeout>5</timeout>
<powerStateTopic>power_state</powerStateTopic>
<powerStateRate>10.0</powerStateRate>
<fullChargeCapacity>87.78</fullChargeCapacity>
<dischargeRate>-474</dischargeRate>
<chargeRate>525</chargeRate>
<dischargeVoltage>15.52</dischargeVoltage>
<chargeVoltage>16.41</chargeVoltage>
</plugin>
-->
</gazebo>
</robot>
Asked by Giri on 2020-07-10 03:32:20 UTC
Comments
Hi, have you fixed this issue? I met the same issue today. Thanks a lot.
Asked by lacfo on 2018-08-26 15:53:00 UTC