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

Marl #55

Open
wants to merge 19 commits into
base: local_planner_subgoalmode
Choose a base branch
from
Open

Marl #55

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
5 changes: 5 additions & 0 deletions .rosinstall
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
uri: https://github.com/ignc-research/stable-baselines3
version: master

- git:
local-name: ../forks/marl/stable-baselines3
uri: https://github.com/ignc-research/stable-baselines3
version: marl

- git:
local-name: ../forks/navigation/local_planner/teb
uri: https://github.com/rst-tu-dortmund/teb_local_planner
Expand Down
Empty file added HPP/model/model.py
Empty file.
16 changes: 16 additions & 0 deletions HPP/record.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from arena_marl.marl_agent.utils.supersuit_utils import MarkovVectorEnv_patched


def store_data():
"""
Store data in a csv file
"""


class Env_Recorder(MarkovVectorEnv_patched):
"""
A wrapper for the environment that records the state and action
"""

def __init__(self):
super(Env_Recorder, self).step(self, actions)
Empty file added HPP/train.py
Empty file.
153 changes: 153 additions & 0 deletions arena_bringup/launch/marl_start_flatland.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<launch>
<param name="use_sim_time" value="true"/>

<arg name="train_mode" default="false"/>
<arg name="model" default="jackal" doc="model type [burger, jackal, ridgeback, agvota, rto, rto_real]"/>
<!--husy does not yet work-->
<param name="train_mode" value="$(arg train_mode)" />
<arg name="use_recorder" default="false"/>
<arg name="record_only_planner" default="true"/>
<arg name="requestID" default="user1"/>

<arg name="local_planner" default="teb" doc="local-planer type [teb, dwa, mpc, rlca, cadrl, arena, rosnav]"/>
<!-- Rosnav agent name -->
<arg name="agent_name" default="$(arg model)" doc = "DRL agent name to be deployed" unless="$(eval arg('local_planner') == 'rosnav')"/>
<arg name="waypoint_generator" default="classic"/>
<arg name="rviz_file" default="nav"/>
<arg name="disable_scenario" default="false"/>
<arg name="scenario_file" default="eval/obstacle_map1_obs10.json" doc="[scenario2.json, empty_map.json, test_scenario.json (pesim)]"/>
<arg name="reset" default="true"/>
<arg name="enable_pedsim" default="true"/>
<arg name="task_mode" default="scenario" doc="[random, manual, staged, scenario]"/>

<!-- To make the training more efficient make sure this step_size*laser_update_rate == 1 -->
<arg name="step_size" default="0.01"/>
<arg name="update_rate" default="500"/>
<arg name="show_viz" default="true"/>
<arg name="viz_pub_rate" default="30" />
<arg name="use_rviz" default="true"/>

<param name="local_planner" value="$(arg local_planner)"/>
<param name="model" value="$(arg model)" />
<param name="agent_name" value="$(arg agent_name)" />
<param name="update_rate" value="$(arg update_rate)" />
<param name="step_size" value="$(arg step_size)" />
<param name="show_viz" value="$(arg show_viz)"/>
<param name="viz_pub_rate" value="$(arg viz_pub_rate)"/>
<param name="use_rviz" value="$(arg use_rviz)"/>
<param name="single_env" value="true"/>

<!-- the folder name under the path simulator_setup/maps -->
<arg name="map_file" default="map1" doc="[map1, floor, indoor, indoor_map1, map_small, map_empty]"/>
<!-- <arg name="map_folder_name" default="map_empty" /> -->
<arg name="map_path" default="$(find simulator_setup)/maps/$(arg map_file)/map.yaml" />
<param name="world_path" value="$(find simulator_setup)/maps/$(arg map_file)/map.world.yaml" />
<param name="map_layer_path" value="$(find simulator_setup)/maps/$(arg map_file)/map_layer.yaml" />
<param name="map_file" value="$(arg map_file)" />

<!-- the velocity of randomly genelized obstacles -->
<arg name="obs_vel" default="0.3" />
<param name="obs_vel" value="$(arg obs_vel)" />


<!-- PARAMS DON'T CHANGE THEM -->
<param name="robot_action_rate" value="5"/>
<param name="laser_update_rate" value="10"/>


<!-- DRL action frequency -->
<arg name="action_frequency" default="10"/>
<param name="action_frequency" value="$(arg action_frequency)"/>

<!-- Map parameters -->
<arg name="global_frame_id" value="map"/>
<arg name="odom_frame_id" value="odom"/>
<arg name="base_frame_id" value="base_footprint"/>
<arg name="odom_ground_truth" default="/odometry/ground_truth"/>

<!-- Robot specific args -->
<arg name='radius' default='0.113' if="$(eval arg('model') == 'burger')"/>
<arg name='speed' default='0.22' if="$(eval arg('model') == 'burger')"/>
<arg name='radius' default='0.267' if="$(eval arg('model') == 'jackal')"/>
<arg name='speed' default='2.0' if="$(eval arg('model') == 'jackal')"/>
<arg name='radius' default='0.625' if="$(eval arg('model') == 'ridgeback')"/>
<arg name='speed' default='1.1' if="$(eval arg('model') == 'ridgeback')"/>
<arg name='radius' default='0.629' if="$(eval arg('model') == 'agvota')"/>
<arg name='speed' default='0.5' if="$(eval arg('model') == 'agvota')"/>
<arg name='radius' default='0.225' if="$(eval arg('model') == 'rto')"/>
<arg name='speed' default='2.78' if="$(eval arg('model') == 'rto')"/>
<arg name='radius' default='0.225' if="$(eval arg('model') == 'rto_real')"/>
<arg name='speed' default='2.78' if="$(eval arg('model') == 'rto_real')"/>
<arg name='radius' default='0.27' if="$(eval arg('model') == 'tiago')"/>
<arg name='speed' default='1.5' if="$(eval arg('model') == 'tiago')"/>
<arg name='radius' default='0.36' if="$(eval arg('model') == 'cob4')"/>
<arg name='speed' default='1.1' if="$(eval arg('model') == 'cob4')"/>
<arg name='radius' default='0.347' if="$(eval arg('model') == 'youbot')"/>
<arg name='speed' default='0.8' if="$(eval arg('model') == 'youbot')"/>
<param name="radius" value="$(arg radius)"/>
<param name="speed" value="$(arg speed)"/>

<!-- data recorder -->
<param name="local_planner" value="$(arg local_planner)"/>
<param name="waypoint_generator" value="$(arg waypoint_generator)"/>
<param name="record_only_planner" value="$(arg record_only_planner)"/>
<param name="scenario_file" value="$(arg scenario_file)"/>
<param name="requestID" value="$(arg requestID)"/>
<group if="$(eval arg('use_recorder') == true)">
<node pkg="arena_evaluation" name="data_recorder_node" type="data_recorder_node.py" />
</group>

<!-- use simulator-->
<include file="$(find arena_bringup)/launch/sublaunch_testing/flatland_simulator.launch">
<arg name="show_viz" value="$(arg show_viz)"/>
<arg name="use_rviz" value="$(arg use_rviz)"/>
<arg name="rviz_file" value="$(arg rviz_file)_$(arg model)"/>
<arg name="model" value="$(arg model)"/>
</include>

<!-- map server-->
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_path)">
<param name="frame_id" value="$(arg global_frame_id)"/>

</node>

<!-- use fake localization-->
<include file="$(find arena_bringup)/launch/sublaunch_testing/fake_localization.launch">

<arg name="global_frame_id" value="$(arg global_frame_id)"/>
<arg name="odom_frame_id" value="$(arg odom_frame_id)"/>
</include>

<!-- start task_generator node -->
<arg name="timeout" default="3.0"/>
<include file="$(find arena_bringup)/launch/sublaunch_testing/task_generator.launch" unless="$(eval arg('disable_scenario') or arg('train_mode'))">
<arg name="scenarios_json_path" value="$(find simulator_setup)/scenarios/$(arg scenario_file)"/>
<arg name="auto_reset" value="$(arg reset)"/>
<arg name="timeout" value="$(arg timeout)"/>
<arg name="task_mode" value="$(arg task_mode)"/>
</include>

<!-- local planner -->
<include file="$(find arena_bringup)/launch/sublaunch_testing/move_base/move_base_$(arg local_planner).launch">
<arg name="model" value="$(arg model)"/>
<arg name="agent_name" value="$(arg agent_name)" if="$(eval arg('local_planner') == 'rosnav')" />
<arg name="train_mode" value="$(arg train_mode)" if="$(eval arg('local_planner') == 'rosnav')" />
<!-- <arg name="speed" value="$(arg speed)"/> -->
</include>

<!-- Pedsim -->
<arg name="simulation_factor" default="1"/>
<arg name="pedsim_update_rate" default="30.0"/>
<arg name="scene_file" default="$(find simulator_setup)/scenarios/empty.xml"/>

<node name="pedsim_simulator" pkg="pedsim_simulator" type="pedsim_simulator" output="screen" if="$(arg enable_pedsim)">
<param name="simulation_factor" value="$(arg simulation_factor)" type="double"/>
<param name="pedsim_update_rate" value="$(arg pedsim_update_rate)" type="double"/>
<param name="scene_file" value="$(arg scene_file)" type="string"/>
</node>

<!-- launch map generator if training with random map-->
<group if="$(eval arg('map_file') == 'random_map')">
<node pkg="simulator_setup" name="map_generator_node" type="map_generator_node.py" />
</group>
</launch>
Loading