Create launch file in python
Hi guys I want to translate my launch file from .launch to .py file I google but I just found how to create them in ROS 2, and I found couple of solutions which didnt worked for me, my launch file is this
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="paused" default="false" />
<arg name="use_sim_time" default="true" />
<arg name="gui" default="false" />
<arg name="headless" default="false" />
<arg name="debug" default="false" />
</include>
<rosparam file="$(find self_balancing_robot)/config/gazebo_ros_control_params.yaml" command="load" />
<!-- Load the URDF into the ROS parameter server -->
<param name="robot_description" command="$(find xacro)/xacro '$(find self_balancing_robot)/urdf/sbrobot.xacro'" />
<!-- Spawn sbrobot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-param robot_description -urdf -model sbrobot" />
</launch>
so how can I create the include world,rosparam,setting param robot_description and finally starting the node spawn urdf in python file
Edit: running the launch file with os.system or Popen is not useful for my project