Skip to content

Commit 28cfb16

Browse files
committed
add final project task1
1 parent 1e3ce3f commit 28cfb16

File tree

7 files changed

+251
-2
lines changed

7 files changed

+251
-2
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
cmake_minimum_required(VERSION 3.0.2)
2+
project(final_project)
3+
4+
5+
## Find catkin macros and libraries
6+
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
7+
## is used, also find other catkin packages
8+
find_package(catkin REQUIRED COMPONENTS
9+
dynamic_reconfigure
10+
rospy
11+
std_msgs
12+
nav_msgs
13+
racecar_msgs
14+
racecar_routing
15+
)
16+
17+
# Uncomment this if the package has a setup.py. This macro ensures
18+
# modules and global scripts declared therein get installed
19+
# See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
20+
catkin_python_setup()
21+
22+
################################################
23+
## Declare ROS messages, services and actions ##
24+
################################################
25+
26+
## To declare and build messages, services or actions from within this
27+
## package, follow these steps:
28+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
29+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
30+
## * In the file package.xml:
31+
## * add a build_depend tag for "message_generation"
32+
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
33+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
34+
## but can be declared for certainty nonetheless:
35+
## * add a exec_depend tag for "message_runtime"
36+
## * In this file (CMakeLists.txt):
37+
## * add "message_generation" and every package in MSG_DEP_SET to
38+
## find_package(catkin REQUIRED COMPONENTS ...)
39+
## * add "message_runtime" and every package in MSG_DEP_SET to
40+
## catkin_package(CATKIN_DEPENDS ...)
41+
## * uncomment the add_*_files sections below as needed
42+
## and list every .msg/.srv/.action file to be processed
43+
## * uncomment the generate_messages entry below
44+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
45+
46+
## Generate messages in the 'msg' folder
47+
# add_message_files(
48+
# FILES
49+
# Message1.msg
50+
# Message2.msg
51+
# )
52+
53+
## Generate services in the 'srv' folder
54+
# add_service_files(
55+
# FILES
56+
# Service1.srv
57+
# Service2.srv
58+
# )
59+
60+
## Generate actions in the 'action' folder
61+
# add_action_files(
62+
# FILES
63+
# Action1.action
64+
# Action2.action
65+
# )
66+
67+
## Generate added messages and services with any dependencies listed here
68+
# generate_messages(
69+
# DEPENDENCIES
70+
# std_msgs # Or other packages containing msgs
71+
# )
72+
73+
################################################
74+
## Declare ROS dynamic reconfigure parameters ##
75+
################################################
76+
77+
## To declare and build dynamic reconfigure parameters within this
78+
## package, follow these steps:
79+
## * In the file package.xml:
80+
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
81+
## * In this file (CMakeLists.txt):
82+
## * add "dynamic_reconfigure" to
83+
## find_package(catkin REQUIRED COMPONENTS ...)
84+
## * uncomment the "generate_dynamic_reconfigure_options" section below
85+
## and list every .cfg file to be processed
86+
87+
## Generate dynamic reconfigure parameters in the 'cfg' folder
88+
# generate_dynamic_reconfigure_options()
89+
90+
91+
###################################
92+
## catkin specific configuration ##
93+
###################################
94+
## The catkin_package macro generates cmake config files for your package
95+
## Declare things to be passed to dependent projects
96+
## INCLUDE_DIRS: uncomment this if your package contains header files
97+
## LIBRARIES: libraries you create in this project that dependent projects also need
98+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
99+
## DEPENDS: system dependencies of this project that dependent projects also need
100+
catkin_package(
101+
CATKIN_DEPENDS
102+
rospy
103+
std_msgs
104+
racecar_msgs
105+
nav_msgs
106+
dynamic_reconfigure
107+
)
108+
109+
#############
110+
## Install ##
111+
#############
112+
113+
# all install targets should use catkin DESTINATION variables
114+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
115+
116+
## Mark executable scripts (Python etc.) for installation
117+
## in contrast to setup.py, you can choose the destination
118+
install(PROGRAMS
119+
# scripts/task2_world_node.py
120+
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
121+
)
122+
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<launch>
2+
<!-- This fix the library linkage issue in RoboStack -->
3+
<env name="LD_PRELOAD" value="$(env CONDA_PREFIX)/lib/libyaml-cpp.so" />
4+
<arg name="output" default="screen" doc="display output to screen or log file"/>
5+
<arg name="odom_topic" default="/Simulation/Pose" doc="ROS topic for the pose"/>
6+
<arg name="control_topic" default="/Control" doc="ROS topic for control input"/>
7+
<arg name="lane_change_cost" default="1" doc="cost of lane change"/>
8+
<arg name="pub_rate" default="30" doc="rate at which to publish the pose"/>
9+
<arg name="init_x" default="3" doc="initial x position"/>
10+
<arg name="init_y" default="0.15" doc="initial y position"/>
11+
<arg name="init_yaw" default="0" doc="initial z position"/>
12+
<arg name="num_dyn_obs" default="0" doc="number of dynamic obsects"/>
13+
<arg name="num_static_obs" default="20" doc="number of static obsects"/>
14+
<arg name="static_obs_size" default="0.2" doc="type of static obsects"/>
15+
<arg name="static_obs_topic" default="/Obstacles/Static" doc="ROS topic for static obstacles"/>
16+
<arg name="dyn_obs_topic" default="/Obstacles/Dynamic" doc="ROS topic for dynamic obstacles"/>
17+
18+
<rosparam file="$(find final_project)/task1.yaml" command="load" />
19+
20+
<node pkg="racecar_interface" type="simulation_node.py" name="simulation_node" output="$(arg output)">
21+
<param name="odom_topic" value="$(arg odom_topic)" />
22+
<param name="control_topic" value="$(arg control_topic)" />
23+
<param name="pub_rate" value="$(arg pub_rate)" />
24+
<param name="init_x" value="$(arg init_x)" />
25+
<param name="init_y" value="$(arg init_y)" />
26+
<param name="init_yaw" value="$(arg init_yaw)" />
27+
</node>
28+
29+
<node pkg="racecar_interface" type="traffic_simulation_node.py" name="traffic_simulation_node" output="$(arg output)">
30+
<param name="map_file" value="$(find racecar_routing)/cfg/track.pkl" />
31+
<param name="num_dyn_obs" value="$(arg num_dyn_obs)" />
32+
<param name="num_static_obs" value="$(arg num_static_obs)" />
33+
<param name="static_obs_size" value="$(arg static_obs_size)" />
34+
<param name="static_obs_topic" value="$(arg static_obs_topic)" />
35+
<param name="dyn_obs_topic" value="$(arg dyn_obs_topic)" />
36+
<param name="pub_rate" value="$(arg pub_rate)" />
37+
</node>
38+
39+
<node pkg="racecar_interface" type="visualization_node.py" name="visualization_node" output="$(arg output)">
40+
<param name="odom_topic" value="$(arg odom_topic)" />
41+
<param name="control_topic" value="$(arg control_topic)"/>
42+
</node>
43+
44+
<include file="$(find racecar_routing)/launch/visualize_map.launch">
45+
<arg name="output" value="$(arg output)"/>
46+
</include>
47+
48+
<include file="$(find racecar_routing)/launch/routing.launch">
49+
<arg name="output" value="$(arg output)"/>
50+
<arg name="odom_topic" value="$(arg odom_topic)"/>
51+
<arg name="lane_change_cost" value="$(arg lane_change_cost)"/>
52+
<arg name="click_goal" value="false"/>
53+
</include>
54+
55+
<node type="rviz" name="rviz" pkg="rviz"
56+
args="-d $(find racecar_interface)/rviz/simulation.rviz" />
57+
58+
<node type="rqt_gui" name="rqt_gui" pkg="rqt_gui"
59+
args="--perspective-file $(find racecar_interface)/rviz/rqt_sim.perspective"/>
60+
61+
</launch>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0"?>
2+
<package format="2">
3+
<name>final_project</name>
4+
<version>0.1.0</version>
5+
<description>The final_project package</description>
6+
7+
<maintainer email="[email protected]">Zixu Zhang</maintainer>
8+
<license>BSD</license>
9+
10+
<author >Zixu Zhang</author>
11+
12+
13+
<buildtool_depend>catkin</buildtool_depend>
14+
15+
<depend>rospy</depend>
16+
<depend>racecar_routing</depend>
17+
<depend>std_msgs</depend>
18+
<depend>racecar_msgs</depend>
19+
<depend>dynamic_reconfigure</depend>
20+
<depend>nav_msgs</depend>
21+
</package>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from distutils.core import setup
2+
from catkin_pkg.python_setup import generate_distutils_setup
3+
4+
d = generate_distutils_setup(
5+
packages=['task2_world'],
6+
package_dir={'': 'scripts'},
7+
)
8+
9+
setup(**d)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
goal_1: [3.15, 0.15]
2+
goal_2: [3.15, 0.47]
3+
goal_3: [5.9, 3.5]
4+
goal_4: [5.6, 3.5]
5+
goal_5: [0.15, 3.5]
6+
goal_6: [0.45, 3.5]
7+
goal_7: [3, 1.1]
8+
goal_8: [3, 0.8]
9+
goal_9: [3, 2.2]
10+
goal_10: [0.75,2.1]
11+
goal_11: [0.75,4.3]
12+
goal_12: [4.6,4.6]
13+
goal_order: [1, 3, 9, 8, 10, 11, 12, 6, 2, 4, 9, 7, 9, 12, 5, 1]
14+
15+
static_obs_location: [
16+
[0.15,4.6],
17+
[0.55, 5.5],
18+
[0.2, 1.5],
19+
[0.85,0.85],
20+
[1.6, 0.15],
21+
[1.8, 0.15],
22+
[2.5, 0.45],
23+
[4.0, 0.15],
24+
[4.2, 0.15],
25+
[4.4, 0.15],
26+
[5.2, 0.6],
27+
[5.9, 1.3],
28+
[5.6, 2],
29+
[5.9, 2.7],
30+
[5.9, 4.1],
31+
[5.9, 4.3],
32+
[5.6, 5.0],
33+
[5.5, 5.2],
34+
[1.5, 0.83],
35+
[1.16, 1.63]
36+
]

0 commit comments

Comments
 (0)