Scripted trajectorie lagging when Gazebo started with launchfile
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
[1mstarted roslaunch server http://UsersPC:40911/[0m
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)
[1mROS_MASTER_URI=http://localhost:11311[0m
]2;/home/user/catkin_ws/src/pathfinder/launch/pathfinder_animated.launch http://localhost:11311
[1mprocess[gazebo-1]: started with pid [25542][0m
[1mprocess[gazebo_gui-2]: started with pid [25547][0m
[1mprocess[spawn_urdf-3]: started with pid [25552][0m
[1m[spawn_urdf-3] process has finished cleanly
log file: /home/user/.ros/log/93683bcc-fcea-11ea-848c-1831bf51188e/spawn_urdf-3*.log[0m
[gazebo_gui-2] killing on exit
[gazebo-1] killing on exit
shutting down processing monitor...
... shutting ...
Hi, I have identical problem. Did you solve it?