-
Notifications
You must be signed in to change notification settings - Fork 0
/
skynetmini.launch
61 lines (46 loc) · 2.37 KB
/
skynetmini.launch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<launch>
<!-- In this launchfile, we demonstrate how to set some initial variables as parameters,
how to record the output file to a place that is persistent, and how to
use a namespace for the node in which we are running. -->
<!-- change the output directory and prefix if this is not where yours is mapped -->
<arg name="bagfileout" default="/ros/catkin_ws/skynetmini"/>
<!-- sets the initial position of the lead car. -->
<param name="/leadcar/x0" type="double" value="40.0" />
<!-- sets the initial velocity of the ego car. -->
<param name="/egocar/v0" type="double" value="0.0" />
<!-- sets the initial position of the ego car. -->
<param name="/egocar/x0" type="double" value="0.0" />
<!-- change the start time if needed -->
<node pkg="rosbag" type="play" name="rosbag_player" args="/ros/catkin_ws/mytest.bag --topics /car/state/vel_x -s 100">
<!-- remap the output to go into the desired car -->
<remap from="/car/state/vel_x" to="/leadcar/vel_x" />
</node>
<!-- By putting this car into a namespace, we keep the variables clean -->
<group ns="leadcar">
<node pkg="odometer" type="odometer" name="odometer_leadcar">
</node>
</group>
<!-- By putting this car into a namespace, we keep the variables clean -->
<group ns="egocar">
<node pkg="carsimplesimulink" type="carsimplesimulink" name="carsimplesimulink_node">
</node>
<node pkg="skynetmini_controller2" type="skynetmini_controller2" name="skynetmini_controller2_node">
<remap from="/cmd_accel" to="/egocar/cmd_accel" />
<remap from="/lead_dist" to="/egocar/lead_dist" />
<remap from="/rel_vel" to="/egocar/rel_vel" />
<remap from="/car/state/vel_x" to="/egocar/vel_x" />
</node>
</group>
<node pkg="subtractor" type="subtractor" name="subtractor_relvel">
<remap from="in1" to="/leadcar/vel_x" />
<remap from="in2" to="/egocar/vel_x" />
<remap from="diff" to="/egocar/rel_vel" />
</node>
<node pkg="subtractor" type="subtractor" name="subtractor_odom">
<remap from="in1" to="/leadcar/odom" />
<remap from="in2" to="/egocar/odom_x" />
<remap from="diff" to="/egocar/lead_dist" />
</node>
<!-- change the output directory if this is not where yours is mapped -->
<node pkg="rosbag" type="record" name="rosbag_recorder" args="-a -o $(arg bagfileout)" />
</launch>