Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for multiple cars in sim #134

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</group>

<!-- environment -->
<include file="$(find rktl_launch)/launch/rocket_league_sim.launch">
<include file="$(find rktl_launch)/launch/rocket_league.launch">
<arg name="render" value="$(arg render)"/>
<arg name="sim_mode" value="$(arg sim_mode)"/>
<arg name="agent_type" value="$(arg agent_type)"/>
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions rktl_launch/launch/car.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<launch>
<arg name="car_id" default="0"/>
<arg name="agent_type" default="planner"/> <!-- none, planner or autonomy -->
<arg name="autonomy_weights" default="model"/>

<arg name="sim_mode" default="realistic"/> <!-- none, realistic or ideal -->
<arg name="perception_delay" default="0.15"/>

<include unless="$(eval sim_mode == 'ideal')"
file="$(find rktl_control)/launch/agent_control.launch">
<arg name="car_name" value="car$(arg car_id)"/>
</include>

<node if="$(eval sim_mode == 'realistic')" ns="cars/car$(arg car_id)"
pkg="rktl_launch" type="topic_delay" name="pose_delay"
args="pose_sync_early pose_sync
geometry_msgs/PoseWithCovarianceStamped $(arg perception_delay)"/>


<include if="$(eval agent_type == 'planner')"
file="$(find rktl_planner)/launch/simple_agent.launch">
<arg name="agent_name" value="agent$(arg car_id)"/>
<arg name="car_name" value="car$(arg car_id)"/>
</include>

<include if="$(eval agent_type == 'autonomy')"
file="$(find rktl_autonomy)/launch/rocket_league/rocket_league_agent.launch">
<arg name="weights_name" value="$(arg autonomy_weights)"/>
</include>
</launch>
44 changes: 32 additions & 12 deletions rktl_launch/launch/rocket_league.launch
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
<launch>
<arg name="render" default="true"/>

<arg name="agent_type" default="planner"/> <!-- Either planner or autonomy -->
<arg name="sim_mode" default="realistic"/> <!-- none, realistic, or ideal -->
<arg name="perception_delay" default="0.15"/>

<arg name="agent_type" default="planner"/> <!-- none, planner or autonomy -->
<arg name="autonomy_weights" default="model"/>

<rosparam command="load" file="$(find rktl_launch)/config/global_params.yaml"/>

<!-- Visualizer -->
<include if="$(arg render)" file="$(find rktl_sim)/launch/visualizer.launch"/>

<!-- Simulator -->
<include unless="$(eval sim_mode == 'none')" file="$(find rktl_sim)/launch/simulator.launch">
<arg name="sim_mode" value="$(arg sim_mode)"/>
</include>

<!-- Ball -->
<include file="$(find rktl_control)/launch/ball.launch"/>
<group if="$(eval sim_mode == 'realistic')">
<node ns="ball" pkg="rktl_launch" type="topic_delay" name="pose_delay"
args="pose_sync_early pose_sync
geometry_msgs/PoseWithCovarianceStamped $(arg perception_delay)"/>
<include file="$(find rktl_control)/launch/ball_filter.launch"/>
</group>

<!-- Cars -->
<include file="$(find rktl_control)/launch/car.launch">
<arg name="car_name" value="car0"/>
</include>
<include file="$(find rktl_control)/launch/hardware_interface.launch"/>
<!-- TODO: Dynamic configuration of cars on launch-->
<include if="$(eval sim_mode == 'none')"
file="$(find rktl_control)/launch/hardware_interface.launch"/>

<include if="$(eval agent_type == 'planner')" file="$(find rktl_planner)/launch/simple_agent.launch">
<arg name="agent_name" value="agent0"/>
<arg name="car_name" value="car0"/>
</include>
<include if="$(eval agent_type == 'autonomy')" file="$(find rktl_autonomy)/launch/rocket_league/rocket_league_agent.launch">
<arg name="weights_name" value="$(arg autonomy_weights)"/>
<include file="$(find rktl_launch)/launch/car.launch">
<arg name="car_id" value="0"/>
<arg name="agent_type" value="$(arg agent_type)"/>
<arg name="autonomy_weights" value="$(arg autonomy_weights)"/>
<arg name="sim_mode" value="$(arg sim_mode)"/>
<arg name="perception_delay" value="$(arg perception_delay)"/>
</include>

<!-- <include file="$(find rktl_launch)/launch/car.launch">
<arg name="car_id" value="1"/>
<arg name="agent_type" value="none"/>
<arg name="autonomy_weights" value="$(arg autonomy_weights)"/>
<arg name="sim_mode" value="$(arg sim_mode)"/>
<arg name="perception_delay" value="$(arg perception_delay)"/>
</include> -->
</launch>
60 changes: 0 additions & 60 deletions rktl_launch/launch/rocket_league_sim.launch

This file was deleted.

20 changes: 14 additions & 6 deletions rktl_sim/config/simulation.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
rate: 10
spawn_height: 0.06

car:
# init_pose:
# pos: [0.5, 0.0, 0.06]
sensor_noise:
pos: [0.01, 0.01, 0.00]
orient: [0.0, 0.0, 0.09]
cars:
- name: "car0"
# init_pose:
# pos: [0.5, 0.0, 0.06]
sensor_noise:
pos: [0.01, 0.01, 0.00]
orient: [0.0, 0.0, 0.09]

- name: "car1"
# init_pose:
# pos: [0.5, 0.0, 0.06]
sensor_noise:
pos: [0.01, 0.01, 0.00]
orient: [0.0, 0.0, 0.09]

ball:
init_speed: 0.0
Expand Down
Loading