-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ros-2-sim-magic' into ros-2-complete
- Loading branch information
Showing
125 changed files
with
4,473 additions
and
405 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import os | ||
import sys | ||
|
||
import launch | ||
import launch_ros.actions | ||
|
||
|
||
def generate_launch_description(): | ||
ld = launch.LaunchDescription([ | ||
launch.actions.DeclareLaunchArgument( | ||
name='agent_name', | ||
default_value='rocket_league_agent' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='render', | ||
default_value='false' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='rate', | ||
default_value='30.0' | ||
), | ||
launch_ros.actions.Node( | ||
package='rktl_autonomy', | ||
executable='cartpole_env', | ||
name='cartpole_env', | ||
output='screen', | ||
parameters=[ | ||
{ | ||
'/use_sim_time': 'true' | ||
}, | ||
{ | ||
'frequency': 1/launch.substitutions.LaunchConfiguration('rate') #'$(eval 1/rate)' | ||
}, | ||
{ | ||
'render': launch.substitutions.LaunchConfiguration('render') | ||
} | ||
] | ||
) | ||
]) | ||
return ld | ||
|
||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
50 changes: 50 additions & 0 deletions
50
rktl_autonomy/launch/rocket_league/rocket_league_agent.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import os | ||
import sys | ||
|
||
import launch | ||
import launch_ros.actions | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
ld = launch.LaunchDescription([ | ||
launch.actions.DeclareLaunchArgument( | ||
name='plot_log', | ||
default_value='false' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='weights_dir', | ||
default_value='~/catkin_ws/data/rocket_league/' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='weights_name', | ||
default_value='model' | ||
), | ||
launch_ros.actions.Node( | ||
package='rktl_autonomy', | ||
executable='rocket_league_agent', | ||
name='rocket_league_agent', | ||
output='screen', | ||
parameters=[ | ||
{ | ||
'weights': launch.substitutions.LaunchConfiguration('weights_dir')+launch.substitutions.LaunchConfiguration('weights_name')#'$(eval weights_dir + weights_name)' | ||
}, | ||
get_package_share_directory('rktl_autonomy') + '/config/rocket_league.yaml' | ||
] | ||
), | ||
launch_ros.actions.Node( | ||
condition=launch.conditions.LaunchConfigurationNotEquals('plot_log', 'false'), | ||
package='rktl_autonomy', | ||
executable='plotter', | ||
name='plotter', | ||
output='screen', | ||
parameters=[ | ||
get_package_share_directory('rktl_autonomy') + '/config/rocket_league.yaml' | ||
] | ||
) | ||
]) | ||
return ld | ||
|
||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
63 changes: 63 additions & 0 deletions
63
rktl_autonomy/launch/rocket_league/rocket_league_train.launch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import os | ||
import sys | ||
|
||
import launch | ||
import launch_ros.actions | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
ld = launch.LaunchDescription([ | ||
launch.actions.DeclareLaunchArgument( | ||
name='plot_log', | ||
default_value='true' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='agent_name', | ||
default_value='rocket_league_agent' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='render', | ||
default_value='false' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='sim_mode', | ||
default_value='ideal' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='rate', | ||
default_value='10.0' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='agent_type', | ||
default_value='none' | ||
), | ||
launch_ros.actions.Node( | ||
condition=launch.conditions.LaunchConfigurationEquals('plot_log', 'true'), | ||
package='rktl_autonomy', | ||
executable='plotter', | ||
name='plotter', | ||
output='screen', | ||
parameters=[ | ||
{ | ||
'/use_sim_time': 'true' | ||
}, | ||
get_package_share_directory('rktl_autonomy') + '/config/rocket_league.yaml' | ||
] | ||
), | ||
launch.actions.IncludeLaunchDescription( | ||
launch.launch_description_sources.PythonLaunchDescriptionSource( | ||
os.path.join(get_package_share_directory('rktl_launch'), 'launch/rocket_league_sim.launch.py') | ||
), | ||
launch_arguments={ | ||
'render': launch.substitutions.LaunchConfiguration('render'), | ||
'sim_mode': launch.substitutions.LaunchConfiguration('sim_mode'), | ||
'agent_type': launch.substitutions.LaunchConfiguration('agent_type') | ||
}.items() | ||
) | ||
]) | ||
return ld | ||
|
||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import os | ||
import sys | ||
|
||
import launch | ||
import launch_ros.actions | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
ld = launch.LaunchDescription([ | ||
launch.actions.DeclareLaunchArgument( | ||
name='plot_log', | ||
default_value='false' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='render', | ||
default_value='true' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='weights', | ||
default_value='~/catkin_ws/data/snake/weights' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='rate', | ||
default_value='10.0' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='snake_size', | ||
default_value='7' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='arena_size', | ||
default_value='10' | ||
), | ||
launch_ros.actions.Node( | ||
package='snakesim', | ||
executable='snake_node', | ||
name='snake_env', | ||
output='screen', | ||
parameters=[ | ||
{ | ||
'render': launch.substitutions.LaunchConfiguration('render') | ||
}, | ||
{ | ||
'snake/initial_segments': launch.substitutions.LaunchConfiguration('snake_size') | ||
}, | ||
{ | ||
'snake/growth': '0' | ||
}, | ||
{ | ||
'arena/bounds': launch.substitutions.LaunchConfiguration('arena_size') | ||
}, | ||
{ | ||
'rate': launch.substitutions.LaunchConfiguration('rate') | ||
} | ||
] | ||
), | ||
launch_ros.actions.Node( | ||
package='rktl_autonomy', | ||
executable='snake_agent', | ||
name='snake_agent', | ||
output='screen', | ||
on_exit=launch.actions.Shutdown(), | ||
parameters=[ | ||
{ | ||
'num_segments': launch.substitutions.LaunchConfiguration('snake_size') | ||
}, | ||
{ | ||
'field_size': launch.substitutions.LaunchConfiguration('arena_size') | ||
}, | ||
{ | ||
'weights': launch.substitutions.LaunchConfiguration('weights') | ||
}, | ||
get_package_share_directory( | ||
'rktl_autonomy') + '/config/snake.yaml' | ||
] | ||
), | ||
launch_ros.actions.Node( | ||
package='rktl_autonomy', | ||
executable='plotter', | ||
name='plotter', | ||
output='screen', | ||
parameters=[ | ||
get_package_share_directory( | ||
'rktl_autonomy') + '/config/snake.yaml' | ||
] | ||
) | ||
]) | ||
return ld | ||
|
||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import os | ||
import sys | ||
|
||
import launch | ||
import launch_ros.actions | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
ld = launch.LaunchDescription([ | ||
launch.actions.DeclareLaunchArgument( | ||
name='plot_log', | ||
default_value='false' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='agent_name', | ||
default_value='snake_agent' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='render', | ||
default_value='false' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='rate', | ||
default_value='10.0' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='snake_size', | ||
default_value='7' | ||
), | ||
launch.actions.DeclareLaunchArgument( | ||
name='arena_size', | ||
default_value='10' | ||
), | ||
launch_ros.actions.Node( | ||
package='snakesim', | ||
executable='snake_node', | ||
name='snake_env', | ||
output='screen', | ||
parameters=[ | ||
{ | ||
'/use_sim_time': 'true' | ||
}, | ||
{ | ||
'render': launch.substitutions.LaunchConfiguration('render') | ||
}, | ||
{ | ||
'snake/initial_segments': launch.substitutions.LaunchConfiguration('snake_size') | ||
}, | ||
{ | ||
'snake/growth': '0' | ||
}, | ||
{ | ||
'arena/bounds': launch.substitutions.LaunchConfiguration('arena_size') | ||
}, | ||
{ | ||
'rate': launch.substitutions.LaunchConfiguration('rate') | ||
} | ||
] | ||
), | ||
launch_ros.actions.Node( | ||
package='rktl_autonomy', | ||
executable='plotter', | ||
name='plotter', | ||
output='screen', | ||
parameters=[ | ||
{ | ||
'/use_sim_time': 'true' | ||
}, | ||
get_package_share_directory( | ||
'rktl_autonomy') + '/config/snake.yaml' | ||
] | ||
) | ||
]) | ||
return ld | ||
|
||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>rktl_autonomy</name> | ||
<version>0.0.0</version> | ||
<version>1.0.0</version> | ||
<description>Deep reinforcement learning for ARC Rocket League project</description> | ||
<maintainer email="[email protected]">Autonomous Robotics Club of Purdue</maintainer> | ||
<license>BSD 3 Clause</license> | ||
<url type="website">http://www.purduearc.com</url> | ||
<author email="[email protected]">James Baxter</author> | ||
<author email="[email protected]">Meenakshi McNamara</author> | ||
<author email="[email protected]">Haddy Alchaer</author> | ||
<author email="[email protected]">Reuben Georgi</author> | ||
<test_depend>ament_copyright</test_depend> | ||
<test_depend>ament_flake8</test_depend> | ||
<test_depend>ament_pep257</test_depend> | ||
<test_depend>python3-pytest</test_depend> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<test_depend>rosunit</test_depend> | ||
|
@@ -20,4 +21,7 @@ | |
<exec_depend>snakesim</exec_depend> | ||
<exec_depend>rktl_msgs</exec_depend> | ||
<exec_depend>rktl_launch</exec_depend> | ||
</package> | ||
<export> | ||
<build_type>ament_python</build_type> | ||
</export> | ||
</package> |
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.