ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Scripted trajectorie lagging when Gazebo started with launchfile

asked 2020-09-22 12:46:41 -0500

Tavaro gravatar image

Hello,

I am not sure if this belongs to the ROS Forum or to the Gazebo Forum. I created a world with an actor which is executing a trajectory. When I open the world with "gazebo world" the trajectory is executed as intended. But when I start gazebo with "roslaunch launchfile" the trajectory is lagging heavily. It does not move for several seconds and sometimes execute the animation normaly. The Sim shows stable fps.

I am using Ubuntu 18.04 on x86 with all latest updates, ROS Melodic and Gazebo 9.

My world:

<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="default">
     <include>
        <uri>model://ground_plane</uri>
     </include>
     <include>
        <uri>model://sun</uri>
     </include>
     <actor name="animated_box">
     <link name="box_link">
        <visual name="visual">
           <geometry>
           <box>
              <size>.2 .2 .2</size>
           </box>
           </geometry>
        </visual>
     </link>
     <script>
        <loop>true</loop>
        <auto_start>true</auto_start>
        <trajectory id="0" type="square">
           <waypoint>
              <time>0.0</time>
              <pose>-1 -1 .11 0 0 0</pose>
           </waypoint>
           <waypoint>
              <time>2.0</time>
              <pose>-1 1 .11 0 0 0</pose>
           </waypoint>
           <waypoint>
              <time>4.0</time>
              <pose>-1 -1 .11 0 0 0</pose>
           </waypoint>
        </trajectory>
     </script>
     </actor>
  </world>

</sdf>

My Launchfile:

    <launch>
    <arg name="model" default="burger" doc="model type [burger, waffle, waffle_pi]"/>

    <arg name="world" value="$(find pathfinder)/worlds/animated.world"/>
    <arg name="x_pos" default="-3.0"/>
    <arg name="y_pos" default="1.0"/>
    <arg name="z_pos" default="0.0"/>
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(arg world)"/>
        <arg name="paused" value="false"/>
        <arg name="use_sim_time" value="true"/>
        <arg name="gui" value="true"/>
        <arg name="headless" value="false"/>
        <arg name="debug" value="false"/>
        <arg name="verbose" value="false" />
    </include>

    <param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />
    <node pkg="gazebo_ros" type="spawn_model" name="spawn_urdf"  args="-urdf -model turtlebot3_$(arg model) -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />  
</launch>

Output from roslaunch:

    ... logging to /home/user/.ros/log/93683bcc-fcea-11ea-848c-1831bf51188e/roslaunch-UsersPC-25520.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
]2;/home/user/catkin_ws/src/pathfinder/launch/pathfinder_animated.launch
started roslaunch server http://UsersPC:40911/

SUMMARY
========

PARAMETERS
* /gazebo/enable_ros_network: True
* /robot_description: <?xml version="1....
* /rosdistro: melodic
* /rosversion: 1.14.9
* /use_sim_time: True

NODES
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
    spawn_urdf (gazebo_ros/spawn_model)

ROS_MASTER_URI=http://localhost:11311
]2;/home/user/catkin_ws/src/pathfinder/launch/pathfinder_animated.launch http://localhost:11311
process[gazebo-1]: started with pid [25542]
process[gazebo_gui-2]: started with pid [25547]
process[spawn_urdf-3]: started with pid [25552]
[spawn_urdf-3] process has finished cleanly
log file: /home/user/.ros/log/93683bcc-fcea-11ea-848c-1831bf51188e/spawn_urdf-3*.log
[gazebo_gui-2] killing on exit
[gazebo-1] killing on exit
shutting down processing monitor...
... shutting ...
(more)
edit retag flag offensive close merge delete

Comments

Hi, I have identical problem. Did you solve it?

wojciechu gravatar image wojciechu  ( 2021-02-03 12:48:15 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-02-04 05:51:32 -0500

Tavaro gravatar image

I did solve it by not using the gazebo animation method. I switch to this method: https://github.com/modulabs/gazebo-tu...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-09-22 12:45:45 -0500

Seen: 373 times

Last updated: Feb 04 '21