This scenario describes simulating multiple agent dynamics and imagery on a single machine. In this scenario, multiple renderers and multiple dynamics nodes are spawned. Each renderer generates imagery from the point of view of the agent.
a) View from Quadrotor 1
b) View from Quadrotor 2
c) View from Car
Fig 1. Views from multiple vehicles rendered using FlightGoggles.
While considering this scenario, the limitations of the renderer should be considered. FlightGoggles requires that the vertical resolution of the screen is greater than the sum of the vertical image sizes to be rendered. For example rendering 3 cameras for 3 agents of size 640x480 would require a vertical resolution of at least 1440.
For this scenario, we need to generate a new launch file based on the number of agents. We provide a Python script to generate this launch file. After setting up the configuration files flightgoggles/script/vehicle_model.yaml
, the launch file can be generated by using flightgoggles/script/generate_launch.py
.
An example configuration yaml file for 2 multirotors and 1 car is shown below
filename: multiVehicle.launch vehicle_models: uav1: type: flightgoggles_uav_dynamics config_dynamics: config/drone/drone.yaml enable_teleop: true uav2: type: flightgoggles_uav_dynamics config_dynamics: config/drone/drone.yaml enable_teleop: false car1: type: flightgoggles_car_dynamics config_dynamics: config/car/car.yaml enable_teleop: false
The nodes and parameters for each vehicle are distinguished using namespaces. For instance /uav/input/motorspeed
in the single-agent example will become /uav1/input/motorspeed
and /uav2/input/motorspeed
which represents the motor speed of two UAV. The following is the basic launch file for multiple-agents scenarios which only contains dynamics simulation nodes.
<launch> <group ns="/uav1"> <node name="flightgoggles_uav_dynamics" pkg="flightgoggles_uav_dynamics" type="node" if="$(arg use_dynamics)" output="screen"> <param name="ignore_collisions" type="bool" value="$(arg ignore_collisions)" /> <param name="tf_prefix" type="string" value="uav1"/> </node> </group> <group ns="/uav2"> <node name="flightgoggles_uav_dynamics" pkg="flightgoggles_uav_dynamics" type="node" if="$(arg use_dynamics)" output="screen"> <param name="ignore_collisions" type="bool" value="$(arg ignore_collisions)" /> <param name="tf_prefix" type="string" value="uav2"/> </node> </group> </launch>
Attachments:
sim-drone2.png (image/png)
sim-drone1.png (image/png)
image-20200818-130515.png (image/png)
image-20200818-130529.png (image/png)
image-20200818-130536.png (image/png)
ros_multi_vehicle_cam0.png (image/png)
ros_multi_vehicle_cam1.png (image/png)
ros_multi_vehicle_cam2.png (image/png)
multi_vehicle_1.png (image/png)
multi_vehicle_2.png (image/png)
multi_vehicle_3.png (image/png)