Geonhee-LEE / mpc_ros

Differential Wheeled Mobile Robot - Nonlinear Model Predictive Control based on ROS
https://www.youtube.com/watch?v=5IqFGBmDGjU
Apache License 2.0
727 stars 169 forks source link

ref_trajectory_tracking_gazebo.launch doesn't launch Gazebo #10

Closed mjestebang closed 3 years ago

mjestebang commented 3 years ago

Hello Geonhee, We solved the error we told you few days ago. It was due to some servingbot libraries when I was doing the catkin_make. But, now, launching roslaunch mpc_ros ref_trajectory_tracking_gazebo.launch opens rviz, but does not open Gazebo. Error: Could not find the 'robot' element in the xml fil at line 80 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp

Thank you very much in advance.

Geonhee-LEE commented 3 years ago

Hello, @mjestebang what kind of model you use?

mjestebang commented 3 years ago

Hello, we are using your serving bot model

Geonhee-LEE commented 3 years ago

Hello @mjestebang please close the #8 issue if you solved.

And I wonder servingbot_ros was already built in your work space? I guess the urdf file didn't upload when you launched. please check again.

mjestebang commented 3 years ago

Yes, i think that's the problem, I don't know if I have some mistake because the comands to launch the urdf I think are correct. I have this lines in the code related to the robot model.

<!--  ************** Robot model ***************  -->
<param name="robot_description" command="$(find xacro)/xacro.py $(find servingbot_description)/urdf/servingbot.urdf.xacro" if="$(eval model == 'serving_bot')"/>

<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find gazebo_ros)/launch/empty_world.launch"/>
    <arg name="paused" value="false"/>
    <arg name="use_sim_time" value="true"/>
    <arg name="gui" value="$(arg gui)"/>
    <arg name="headless" value="false"/>
    <arg name="debug" value="false"/>
</include>

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model servingbot -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -R $(arg roll) -P $(arg pitch) -Y $(arg yaw) -param robot_description" />

<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="50.0" />
</node>
Geonhee-LEE commented 3 years ago

@mjestebang Hi, Why don't you change the name from servingbot to robot in urdf.xacro file and launch file?

mjestebang commented 3 years ago

Hi, we have tried to change the name of the robot, but it doesn't make any change in the .launch. Apparently, the RViz does read correctly de xml file (.urdf.xacro). We realize that the mistake is that RVIZ doesn't receive odometry.

Captura de pantalla de 2021-01-19 17-15-01

On the other hand, when we launch the node, we get this message in the terminal. Error: Could not find the 'robot' element in the xml file at line 80 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp

Thanks you so much. We are waiting your response.

Geonhee-LEE commented 3 years ago

@mjestebang Hi, did you install robot_state_publisher package as well?

mjestebang commented 3 years ago

Thanks you so much. You've been a great help.

Simon-Leung commented 2 years ago

@mjestebang hello, how did you solved this:

Error: Could not find the 'robot' element in the xml fil at line 80 in /build/urdfdom-YMMa9X/urdfdom-1.0.0/urdf_parser/src/model.cpp