Skip to content
Open
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
66 changes: 52 additions & 14 deletions src/common/common_meta/launch/sim_acceleration_launch.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,76 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import ExecuteProcess, RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch_ros.actions import Node


def generate_launch_description():
modprobe_vcan = ExecuteProcess(
cmd=['sudo', 'modprobe', 'vcan'],
shell=False
)
create_can0 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can0 >/dev/null 2>&1 || sudo ip link add dev can0 type vcan"],
shell=False
)
up_can0 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can0'],
shell=False
)
create_can1 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can1 >/dev/null 2>&1 || sudo ip link add dev can1 type vcan"],
shell=False
)
up_can1 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can1'],
shell=False
)
can_sequence = [
RegisterEventHandler(
OnProcessExit(target_action=modprobe_vcan, on_exit=[create_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can0, on_exit=[up_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=up_can0, on_exit=[create_can1])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can1, on_exit=[up_can1])
)
]

return LaunchDescription([
modprobe_vcan,
*can_sequence,
create_node(pkg='acc_planning',
params=[{'target_speed': 15.0,
'max_acc': 5.0,
'max_dec': 5.0,
params=[{'target_speed': 50.0,
'max_acc': 15.0,
'max_dec': 10.0,
'track_length': 75.0,
'finish_offset': 2.0,
'debug': False}]),
create_node(pkg='controller',
params=[{'trajectory_topic': "/acc_planning/trajectory",
'min_cmd': -5.0,
'max_cmd': 5.0,
'min_cmd': -15.0,
'max_cmd': 25.0,
'look_ahead_distance': 8.0,
'debug': False}]),
create_node(pkg='visualization'),
create_node(pkg='arussim_interface'),
create_node(pkg='can_interface',
params=[{'simulation': True}]),
create_node(pkg='car_state',
params=[{'simulation': True,
'mission': 'acceleration',
'extensometer_topic': '/arussim/extensometer',
'imu_ax_topic': '/arussim/IMU/ax',
'imu_ay_topic': '/arussim/IMU/ay',
'imu_r_topic': '/arussim/IMU/yaw_rate',
'control_vx_topic': '/arussim/control_vx',
'control_vy_topic': '/arussim/control_vy',
'control_r_topic': '/arussim/control_r',
'extensometer_topic': '/can_interface/extensometer',
'imu_ax_topic': '/can_interface/IMU/ax',
'imu_ay_topic': '/can_interface/IMU/ay',
'imu_r_topic': '/can_interface/IMU/yaw_rate',
'control_vx_topic': '/can_interface/control_vx',
'control_vy_topic': '/can_interface/control_vy',
'control_r_topic': '/can_interface/control_r',
'debug': False}]),
create_node(pkg='graph_slam',
params=[{'lidar_topic': '/arussim/perception',
Expand Down
56 changes: 47 additions & 9 deletions src/common/common_meta/launch/sim_autocross_launch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import ExecuteProcess, RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch_ros.actions import Node


def generate_launch_description():
modprobe_vcan = ExecuteProcess(
cmd=['sudo', 'modprobe', 'vcan'],
shell=False
)
create_can0 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can0 >/dev/null 2>&1 || sudo ip link add dev can0 type vcan"],
shell=False
)
up_can0 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can0'],
shell=False
)
create_can1 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can1 >/dev/null 2>&1 || sudo ip link add dev can1 type vcan"],
shell=False
)
up_can1 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can1'],
shell=False
)
can_sequence = [
RegisterEventHandler(
OnProcessExit(target_action=modprobe_vcan, on_exit=[create_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can0, on_exit=[up_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=up_can0, on_exit=[create_can1])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can1, on_exit=[up_can1])
)
]

return LaunchDescription([
modprobe_vcan,
*can_sequence,
create_node(pkg='path_planning',
params=[{'v_max': 7.0,
'ax_max': 5.0,
Expand All @@ -21,17 +58,18 @@ def generate_launch_description():
'first_lap_steer_control': "PP",
'debug': False}]),
create_node(pkg='visualization'),
create_node(pkg='arussim_interface'),
create_node(pkg='can_interface',
params=[{'simulation': True}]),
create_node(pkg='car_state',
params=[{'simulation': True,
'mission': 'autocross',
'extensometer_topic': '/arussim/extensometer',
'imu_ax_topic': '/arussim/IMU/ax',
'imu_ay_topic': '/arussim/IMU/ay',
'imu_r_topic': '/arussim/IMU/yaw_rate',
'control_vx_topic': '/arussim/control_vx',
'control_vy_topic': '/arussim/control_vy',
'control_r_topic': '/arussim/control_r',
'extensometer_topic': '/can_interface/extensometer',
'imu_ax_topic': '/can_interface/IMU/ax',
'imu_ay_topic': '/can_interface/IMU/ay',
'imu_r_topic': '/can_interface/IMU/yaw_rate',
'control_vx_topic': '/can_interface/control_vx',
'control_vy_topic': '/can_interface/control_vy',
'control_r_topic': '/can_interface/control_r',
'debug': False}]),
create_node(pkg='graph_slam',
params=[{'lidar_topic': '/arussim/perception',
Expand Down
56 changes: 47 additions & 9 deletions src/common/common_meta/launch/sim_ebs_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import ExecuteProcess, RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch_ros.actions import Node


def generate_launch_description():
modprobe_vcan = ExecuteProcess(
cmd=['sudo', 'modprobe', 'vcan'],
shell=False
)
create_can0 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can0 >/dev/null 2>&1 || sudo ip link add dev can0 type vcan"],
shell=False
)
up_can0 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can0'],
shell=False
)
create_can1 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can1 >/dev/null 2>&1 || sudo ip link add dev can1 type vcan"],
shell=False
)
up_can1 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can1'],
shell=False
)
can_sequence = [
RegisterEventHandler(
OnProcessExit(target_action=modprobe_vcan, on_exit=[create_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can0, on_exit=[up_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=up_can0, on_exit=[create_can1])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can1, on_exit=[up_can1])
)
]

return LaunchDescription([
modprobe_vcan,
*can_sequence,
create_node(pkg='acc_planning',
params=[{'target_speed': 12.0,
'max_acc': 4.2,
Expand All @@ -21,17 +58,18 @@ def generate_launch_description():
'look_ahead_distance': 8.0,
'debug': True}]),
create_node(pkg='visualization'),
create_node(pkg='arussim_interface'),
create_node(pkg='can_interface',
params=[{'simulation': True}]),
create_node(pkg='car_state',
params=[{'simulation': True,
'mission': 'acceleration',
'extensometer_topic': '/arussim/extensometer',
'imu_ax_topic': '/arussim/IMU/ax',
'imu_ay_topic': '/arussim/IMU/ay',
'imu_r_topic': '/arussim/IMU/yaw_rate',
'control_vx_topic': '/arussim/control_vx',
'control_vy_topic': '/arussim/control_vy',
'control_r_topic': '/arussim/control_r',
'extensometer_topic': '/can_interface/extensometer',
'imu_ax_topic': '/can_interface/IMU/ax',
'imu_ay_topic': '/can_interface/IMU/ay',
'imu_r_topic': '/can_interface/IMU/yaw_rate',
'control_vx_topic': '/can_interface/control_vx',
'control_vy_topic': '/can_interface/control_vy',
'control_r_topic': '/can_interface/control_r',
'debug': False}]),
create_node(pkg='graph_slam',
params=[{'lidar_topic': '/arussim/perception',
Expand Down
56 changes: 47 additions & 9 deletions src/common/common_meta/launch/sim_skidpad_launch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import ExecuteProcess, RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch_ros.actions import Node


def generate_launch_description():
modprobe_vcan = ExecuteProcess(
cmd=['sudo', 'modprobe', 'vcan'],
shell=False
)
create_can0 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can0 >/dev/null 2>&1 || sudo ip link add dev can0 type vcan"],
shell=False
)
up_can0 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can0'],
shell=False
)
create_can1 = ExecuteProcess(
cmd=['bash', '-c', "ip link show can1 >/dev/null 2>&1 || sudo ip link add dev can1 type vcan"],
shell=False
)
up_can1 = ExecuteProcess(
cmd=['sudo', 'ip', 'link', 'set', 'up', 'can1'],
shell=False
)
can_sequence = [
RegisterEventHandler(
OnProcessExit(target_action=modprobe_vcan, on_exit=[create_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can0, on_exit=[up_can0])
),
RegisterEventHandler(
OnProcessExit(target_action=up_can0, on_exit=[create_can1])
),
RegisterEventHandler(
OnProcessExit(target_action=create_can1, on_exit=[up_can1])
)
]

return LaunchDescription([
modprobe_vcan,
*can_sequence,
create_node(pkg='skidpad_planning',
params=[{'target_first_lap': 7.0,
'target_second_lap': 10.0,
Expand All @@ -25,17 +62,18 @@ def generate_launch_description():
'look_ahead_distance': 6.0,
'debug': False}]),
create_node(pkg='visualization'),
create_node(pkg='arussim_interface'),
create_node(pkg='can_interface',
params=[{'simulation': True}]),
create_node(pkg='car_state',
params=[{'simulation': True,
'mission': 'skidpad',
'extensometer_topic': '/arussim/extensometer',
'imu_ax_topic': '/arussim/IMU/ax',
'imu_ay_topic': '/arussim/IMU/ay',
'imu_r_topic': '/arussim/IMU/yaw_rate',
'control_vx_topic': '/arussim/control_vx',
'control_vy_topic': '/arussim/control_vy',
'control_r_topic': '/arussim/control_r',
'extensometer_topic': '/can_interface/extensometer',
'imu_ax_topic': '/can_interface/IMU/ax',
'imu_ay_topic': '/can_interface/IMU/ay',
'imu_r_topic': '/can_interface/IMU/yaw_rate',
'control_vx_topic': '/can_interface/control_vx',
'control_vy_topic': '/can_interface/control_vy',
'control_r_topic': '/can_interface/control_r',
'debug': False}]),
create_node(pkg='graph_slam',
params=[{'lidar_topic': '/arussim/perception',
Expand Down
Loading