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

Failed to load xml from ROS param [ros_ign_gazebo create] #119

Closed
chama1176 opened this issue Oct 23, 2020 · 3 comments
Closed

Failed to load xml from ROS param [ros_ign_gazebo create] #119

chama1176 opened this issue Oct 23, 2020 · 3 comments
Labels
bug Something isn't working 🏰 citadel Ignition Citadel ROS 2 ROS 2

Comments

@chama1176
Copy link
Contributor

Test environment

  • Ubuntu 20.04
  • ROS2 Foxy
  • ignition citadel

Test launch file

<?xml version="1.0"?>
<launch>
  <group>
    <include file="$(find-pkg-share ros_ign_gazebo)/launch/ign_gazebo.launch.py">
      <arg name="ign_args" value="empty.sdf" />
    </include>
  </group>

  <node pkg="ros_ign_gazebo" exec="create" args="-world empty -param robot_description" output="screen">
    <param name="robot_description" value="$(command 'cat $(find-pkg-share test_robot_ign_gazebo)/urdf/my_robot.urdf')" />
  </node>
</launch>

This failed for "Failed to get XML from param".

How I resolved

Before

https://github.com/ignitionrobotics/ros_ign/blob/94a719adcf6005fae657a174489cb99349c33ced/ros_ign_gazebo/src/create.cpp#L44-L52

After

   ros::init(_argc, _argv, "ign_create"); 
   ros::NodeHandle nh; 

   gflags::AllowCommandLineReparsing(); 
   gflags::SetUsageMessage( 
       R"(Usage: create -world [arg] [-file FILE] [-param PARAM] [-string STRING] 
                        [-name NAME] [-X X] [-Y Y] [-Z Z] [-Roll ROLL] 
                        [-Pitch PITCH] [-Yaw YAW])"); 
   gflags::ParseCommandLineFlags(&_argc, &_argv, true);   

This change works good for me.

@osrf-triage osrf-triage added this to Inbox in Core development Oct 23, 2020
@chapulina
Copy link
Contributor

Thank you for ticketing the issue, @chama1176 . I haven't tried reproducing the issue, but your proposed fix looks ok to me. Would you be able to open a pull request with the fix?

@chapulina chapulina added bug Something isn't working ROS 2 ROS 2 🏰 citadel Ignition Citadel labels Oct 26, 2020
@chama1176
Copy link
Contributor Author

Thank you for confirmation.
OK.I will send a pull request with the fix.

chama1176 pushed a commit to chama1176/ros_ign that referenced this issue Oct 27, 2020
chama1176 pushed a commit to chama1176/ros_ign that referenced this issue Oct 27, 2020
Signed-off-by: yakushigawa <kaede_yakushigawa@yanmar.com>
chapulina pushed a commit that referenced this issue Oct 29, 2020
Signed-off-by: yakushigawa <kaede_yakushigawa@yanmar.com>
Signed-off-by: Kaede Yakushigawa <kaede6120@gmail.com>

Co-authored-by: yakushigawa <kaede_yakushigawa@yanmar.com>
@chapulina
Copy link
Contributor

Should be fixed by #120

Core development automation moved this from Inbox to Done Oct 29, 2020
@j-rivero j-rivero removed this from Done in Core development May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🏰 citadel Ignition Citadel ROS 2 ROS 2
Projects
None yet
Development

No branches or pull requests

2 participants