Skip to content

How to debug roslaunch with IDE RoboWare or Visual Code(RotorS MAV gazebo simulator)? #2

@diogon01

Description

@diogon01

Hello guys,

I installed RotorS the MAV Gazebo simulator and it's worked fine.( link for RotorS)
but a trie use Debug in IDE RoboWare and i don't have success how to debug launch file witch RoboWare or Visual Code?
Thank's guys

My launch this file: ~/catkin_ws/src/rotors_simulator/rotors_gazebo/launch/mav_hovering_example_with_vi_sensor.launch

image description

My launch file launch in this exactly moment:

<launch>
 <arg name="mav_name" default="firefly"/>
 <arg name="world_name" default="basic"/>
 <arg name="enable_logging" default="true" />
 <arg name="enable_ground_truth" default="true" />
 <arg name="log_file" default="$(arg mav_name)" />

<env name="GAZEBO_MODEL_PATH" value="${GAZEBO_MODEL_PATH}:$(find rotors_gazebo)/models"/>
<env name="GAZEBO_RESOURCE_PATH" value="${GAZEBO_RESOURCE_PATH}:$(find rotors_gazebo)/models"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
   <arg name="world_name" value="$(find rotors_gazebo)/worlds/$(arg world_name).world" />
   <arg name="debug" value="true"/>
   <arg name="paused" value="true"/>
<!-- <arg name="gui" value="false"/> -->
</include>

<group ns="$(arg mav_name)">


 <include file="$(find rotors_gazebo)/launch/spawn_mav.launch">
      <arg name="mav_name" value="$(arg mav_name)" />
      <arg name="model" value="$(find rotors_description)/urdf/mav_with_vi_sensor.gazebo" />
      <arg name="enable_logging" value="$(arg enable_logging)" />
      <arg name="enable_ground_truth" value="$(arg enable_ground_truth)" />
      <arg name="log_file" value="$(arg log_file)"/>
    </include>
    <node name="lee_position_controller_node" pkg="rotors_control" type="lee_position_controller_node" output="screen">
      <rosparam command="load" file="$(find rotors_gazebo)/resource/lee_controller_$(arg mav_name).yaml" />
      <rosparam command="load" file="$(find rotors_gazebo)/resource/$(arg mav_name).yaml" />
      <remap from="odometry" to="odometry_sensor1/odometry" />
    </node>
    <node name="hovering_example" pkg="rotors_gazebo" type="hovering_example" output="screen"/>
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
    <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  </group>
</launch>

My configuration debug in Roboware(launch.json)

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "C++",
			"type": "gdb",
			"request": "launch",
			"target": "${file}",
			"cwd": "${workspaceRoot}",
			"arguments": "roscore"
		},
		{
			"name": "C++ (remote)",
			"type": "gdb",
			"request": "launch",
			"target": "dev${relativeFile}",
			"cwd": "${workspaceRoot}",
			"ssh": {
				"host": "remotehost",
				"user": "remoteuser",
				"keyfile": "/home/user/.ssh/id_rsa",
				"cwd": "/home/remote/ws"
			}
		},
		{
			"name": "Python",
			"type": "python",
			"request": "launch",
			"stopOnEntry": true,
			"pythonPath": "${config:python.pythonPath}",
			"program": "${file}",
			"debugOptions": [
				"WaitOnAbnormalExit",
				"WaitOnNormalExit",
				"RedirectOutput"
			]
		}
	]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions