Closed varunvp closed 6 years ago
First, the dev guide states ROS Kinetic is the supported version, along with Ubuntu 16.04.
Second, the gazebo argument exists here: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/9cbc4bfd9b0caf763387cb203f6bf695071cae07/gazebo_ros/launch/empty_world.launch#L17
So, either you have version issues, or you modified the posix_sitl.launch
file, in a way where it is no longer defining the argument. i.e. you must have this line: https://github.com/PX4/Firmware/blob/ed261c76daf6e5a40fab7cec6079b1febff4be85/launch/posix_sitl.launch#L23
to accompany this line:
https://github.com/PX4/Firmware/blob/ed261c76daf6e5a40fab7cec6079b1febff4be85/launch/posix_sitl.launch#L33
You'd have to post your complete version of the launch file for me to see this. I suggest restoring the launch file provided by PX4 to it's unmodified state and use the recommended versions. I'm closing this, as there is no bug, but fell free to post back if you still have issues after following the suggested actions.
I compared your launch file with the launch file in my gazebo_ros directory, and mine doesn't have respawn_gazebo argument.
<launch>
<!-- these are the arguments you can pass this launch file, for example paused:=true -->
<arg name="paused" default="false"/>
<arg name="use_sim_time" default="true"/>
<arg name="extra_gazebo_args" default=""/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<arg name="physics" default="ode"/>
<arg name="verbose" default="false"/>
<arg name="world_name" default="worlds/empty.world"/> <!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->
<!-- set use_sim_time flag -->
<group if="$(arg use_sim_time)">
<param name="/use_sim_time" value="true" />
</group>
<!-- set command arguments -->
<arg unless="$(arg paused)" name="command_arg1" value=""/>
<arg if="$(arg paused)" name="command_arg1" value="-u"/>
<arg unless="$(arg headless)" name="command_arg2" value=""/>
<arg if="$(arg headless)" name="command_arg2" value="-r"/>
<arg unless="$(arg verbose)" name="command_arg3" value=""/>
<arg if="$(arg verbose)" name="command_arg3" value="--verbose"/>
<arg unless="$(arg debug)" name="script_type" value="gzserver"/>
<arg if="$(arg debug)" name="script_type" value="debug"/>
<!-- start gazebo server-->
<node name="gazebo" pkg="gazebo_ros" type="$(arg script_type)" respawn="false" output="screen"
args="$(arg command_arg1) $(arg command_arg2) $(arg command_arg3) -e $(arg physics) $(arg extra_gazebo_args) $(arg world_name)" />
<!-- start gazebo client -->
<group if="$(arg gui)">
<node name="gazebo_gui" pkg="gazebo_ros" type="gzclient" respawn="false" output="screen"/>
</group>
</launch>
As for the launch file, here it is, as is
<?xml version="1.0"?>
<launch>
<!-- Posix SITL environment launch script -->
<!-- launches PX4 SITL, Gazebo environment, and spawns vehicle -->
<!-- vehicle pose -->
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" default="0"/>
<arg name="R" default="0"/>
<arg name="P" default="0"/>
<arg name="Y" default="0"/>
<!-- vehicle model and world -->
<arg name="est" default="ekf2"/>
<arg name="vehicle" default="iris"/>
<arg name="world" default="$(find mavlink_sitl_gazebo)/worlds/empty.world"/>
<arg name="sdf" default="$(find mavlink_sitl_gazebo)/models/$(arg vehicle)/$(arg vehicle).sdf"/>
<arg name="rcS" default="$(find px4)/posix-configs/SITL/init/$(arg est)/$(arg vehicle)"/>
<!-- gazebo configs -->
<arg name="gui" default="true"/>
<arg name="debug" default="false"/>
<arg name="verbose" default="false"/>
<arg name="paused" default="false"/>
<arg name="respawn_gazebo" default="false"/>
<!-- PX4 SITL -->
<node name="sitl" pkg="px4" type="px4" output="screen" args="$(find px4) $(arg rcS)"/>
<!-- Gazebo sim -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="gui" value="$(arg gui)"/>
<arg name="world_name" value="$(arg world)"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="verbose" value="$(arg verbose)"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="respawn_gazebo" value="$(arg respawn_gazebo)"/> //**This is the 'unused' arg. If this is commented, it works properly**
</include>
<!-- gazebo model -->
<node name="$(anon vehicle_spawn)" pkg="gazebo_ros" type="spawn_model" output="screen" args="-sdf -file $(arg sdf) -model $(arg vehicle) -x $(arg x) -y $(arg y) -z $(arg z) -R $(arg R) -P $(arg P) -Y $(arg Y)"/>
</launch>
I haven't done any modifications to this file. So this must likely be a version issue?
Yup, there's your problem... The argument was added to the gazebo_ros package with Kinetic back in 2015. I guess it didn't make it into Indigo.
The commit is here: https://github.com/ros-simulation/gazebo_ros_pkgs/commit/71dcc776c6efdd9408e69e3a39dcd55212419226#diff-a1a63a469cbe17191421efbe801f4491
So, either pull it out of the launch, like you did, or upgrade.
EDIT: Here's the official launch for Indigo, which matches the one you shared: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/indigo-devel/gazebo_ros/launch/empty_world.launch
You could also try to make a PR to their repo (I'm not sure if packages are still updated for Indigo) and change it in the gazebo_ros launch file (so you have the feature the arg adds).
I am getting this error "unused args [interactive] for include of [/home/shriram/catkin_ws/src/Firmware/launch/posix_sitl.launch] The traceback for the exception was written to the log file" when i run roslaunch command This is my posix_sitl launch file.please tell me what i have to do
@shriram75 Your issue is unrelated to this thread. Please open a new issue
Bug Report
When I run the following commands, as on the website https://dev.px4.io/en/simulation/ros_interface.html,
I get this error when executing the last line
This is what is there in the log file
In the posix_sitl.launch file, I found the unused argument
<arg name="respawn_gazebo" value="$(arg respawn_gazebo)"/>
When I removed this line and run the simulation, it worked as expected. I want to know if this is a bug, or I'm missing something.
I'm running ROS Indigo on Ubuntu 14.04, using Gazebo 7.