Skip to content

Commit 3972103

Browse files
author
spongebob
committed
ubuntu commit
1 parent 3d01268 commit 3972103

File tree

8 files changed

+193
-10
lines changed

8 files changed

+193
-10
lines changed

readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ vehicle_cmd包含所有的控制消息,包含四元数,线速度,加速度
4646
17.有关上车实践方面,需要加上twist_filter,在其中发出话题ctrl_cmd注意怎么用
4747
18.roslaunch autoware_camera_lidar_calibrator camera_lidar_calibration.launch intrinsics_file:=/home/ne0/Desktop/calib_heat_camera1_rear_center_fisheye.yaml compressed_stream:=True camera_id:=camera1
4848
标定的命令
49+
19.有关停车的命令
50+
要将pure_pusuit设置为跟踪路径点的速度,velocity_set中设置为points_raw
51+
20.velocity_Set启动的是velocity_set_option.launch
52+
4953
安装autoware 1.14的教程:
5054
https://www.cnblogs.com/hgl0417/p/14617025.html
5155
https://gitlab.com/autowarefoundation/autoware.ai/autoware/-/wikis/Source-Build

src/autoware/core_planning/waypoint_planner/include/waypoint_planner/astar_avoid/astar_avoid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class AstarAvoid
7070
bool enable_avoidance_; // enable avoidance mode
7171
double avoid_waypoints_velocity_; // constant velocity on planned waypoints [km/h]
7272
double avoid_start_velocity_; // self velocity for staring avoidance behavior [km/h]
73-
double replan_interval_; // replan interval for avoidance planning [Hz]
73+
double replan_interval_; // replan interval for avoidance planning [Hz]是s吗???
7474
int search_waypoints_size_; // range of waypoints for incremental search [-]
7575
int search_waypoints_delta_; // skipped waypoints for incremental search [-]
7676
int closest_search_size_; // search closest waypoint around your car [-]

src/autoware/core_planning/waypoint_planner/launch/astar_avoid.launch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<arg name="costmap_topic" default="semantics/costmap_generator/occupancy_grid" />
99
<arg name="enable_avoidance" default="true" />
1010
<arg name="avoid_waypoints_velocity" default="10.0" />
11-
<arg name="avoid_start_velocity" default="3.6" />
12-
<arg name="replan_interval" default="2.0" />
11+
<arg name="avoid_start_velocity" default="5" />
12+
<arg name="replan_interval" default="0.5" />
1313
<arg name="search_waypoints_size" default="50" />
1414
<arg name="search_waypoints_delta" default="2" />
1515
<arg name="closest_search_size" default="30" />

src/autoware/core_planning/waypoint_planner/src/astar_avoid/astar_avoid.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ AstarAvoid::AstarAvoid()
3434

3535
private_nh_.param<bool>("enable_avoidance", enable_avoidance_, true);
3636
private_nh_.param<double>("avoid_waypoints_velocity", avoid_waypoints_velocity_, 10.0);
37-
private_nh_.param<double>("avoid_start_velocity", avoid_start_velocity_, 3.6);
38-
private_nh_.param<double>("replan_interval", replan_interval_, 2.0);
37+
private_nh_.param<double>("avoid_start_velocity", avoid_start_velocity_, 5);
38+
private_nh_.param<double>("replan_interval", replan_interval_, 0.5);
3939
private_nh_.param<int>("search_waypoints_size", search_waypoints_size_, 50);
4040
private_nh_.param<int>("search_waypoints_delta", search_waypoints_delta_, 2);
4141
private_nh_.param<int>("closest_search_size", closest_search_size_, 30);
@@ -171,7 +171,7 @@ void AstarAvoid::run()
171171

172172
// avoidance mode
173173
bool found_obstacle = (obstacle_waypoint_index_ >= 0);
174-
//avoid_start_velocity_避让开始时自车速度1m/s
174+
//avoid_start_velocity_避让开始时自车速度1.2m/s
175175
bool avoid_velocity = (current_velocity_.twist.linear.x < avoid_start_velocity_ / 3.6);
176176

177177
// update state
@@ -192,7 +192,7 @@ void AstarAvoid::run()
192192

193193
if (!found_obstacle)
194194
{
195-
ROS_INFO("STOPPING -> RELAYING, Obstacle disappers");
195+
//ROS_INFO("STOPPING -> RELAYING, Obstacle disappers");
196196
state_ = AstarAvoid::STATE::RELAYING;
197197
}
198198
//从停车模式转换为规划模式
@@ -201,7 +201,6 @@ void AstarAvoid::run()
201201
{
202202
ROS_INFO("STOPPING -> PLANNING, Start A* planning");
203203
state_ = AstarAvoid::STATE::PLANNING;
204-
std::cout << "planning" << std::endl;
205204
}
206205
}
207206
//确定避障路线并相应添加进avoid_waypoints_,同时更新传入函数的end_of_avoid_index,
@@ -277,7 +276,8 @@ bool AstarAvoid::planAvoidWaypoints(int& end_of_avoid_index)
277276
for (int i = search_waypoints_delta_; i < static_cast<int>(search_waypoints_size_); i += search_waypoints_delta_)
278277
{
279278
// update goal index
280-
int goal_waypoint_index = closest_waypoint_index + obstacle_waypoint_index_ + i;
279+
//ff修改为+5
280+
int goal_waypoint_index = closest_waypoint_index + obstacle_waypoint_index_ + i + 5;
281281
if (goal_waypoint_index >= static_cast<int>(avoid_waypoints_.waypoints.size()))
282282
{
283283
break;
@@ -304,8 +304,9 @@ bool AstarAvoid::planAvoidWaypoints(int& end_of_avoid_index)
304304

305305
if (found_path)
306306
{
307-
pub.publish(astar_.getPath());
307+
pub.publish(astar_.getPath());//发布获得的避障路径
308308
end_of_avoid_index = goal_waypoint_index;
309+
//这个函数用于生效astar规划的路径astar_path,把current_point和goal中间的那一段用astar_path替换
309310
mergeAvoidWaypoints(astar_.getPath(), end_of_avoid_index);
310311
if (avoid_waypoints_.waypoints.size() > 0)
311312
{

src/autoware/core_planning/waypoint_planner/src/velocity_set/velocity_set.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ EControl crossWalkDetection(const pcl::PointCloud<pcl::PointXYZ>& points, const
244244
return EControl::KEEP; // find no obstacles
245245
}
246246

247+
//障碍物检测,需要停车。对当前位置后的路径点进行障碍物检测,如果出现points_no_ground点云聚集则视为障碍物点
247248
int detectStopObstacle(const pcl::PointCloud<pcl::PointXYZ>& points, const int closest_waypoint,
248249
const autoware_msgs::Lane& lane, const CrossWalk& crosswalk, double stop_range,
249250
double points_threshold, const geometry_msgs::PoseStamped& localizer_pose,
@@ -320,6 +321,7 @@ int detectStopObstacle(const pcl::PointCloud<pcl::PointXYZ>& points, const int c
320321
return stop_obstacle_waypoint;
321322
}
322323

324+
//障碍物检测,需要减速
323325
int detectDecelerateObstacle(const pcl::PointCloud<pcl::PointXYZ>& points, const int closest_waypoint,
324326
const autoware_msgs::Lane& lane, const double stop_range, const double deceleration_range,
325327
const double points_threshold, const geometry_msgs::PoseStamped& localizer_pose,
@@ -377,6 +379,7 @@ EControl pointsDetection(const pcl::PointCloud<pcl::PointXYZ>& points, const int
377379
int* obstacle_waypoint, ObstaclePoints* obstacle_points)
378380
{
379381
// no input for detection || no closest waypoint
382+
//如果没有点云同时没有从其他节点得到结果,或者当前位置检测失败
380383
if ((points.empty() == true && vs_info.getDetectionResultByOtherNodes() == -1) || closest_waypoint < 0)
381384
return EControl::KEEP;
382385

@@ -419,8 +422,10 @@ EControl pointsDetection(const pcl::PointCloud<pcl::PointXYZ>& points, const int
419422
}
420423

421424
// about 5.0 meter
425+
//存在停止障碍物且存在减速障碍物
422426
double waypoint_interval =
423427
getPlaneDistance(lane.waypoints[0].pose.pose.position, lane.waypoints[1].pose.pose.position);
428+
//计算5米需要几个路径点
424429
int stop_decelerate_threshold = 5 / waypoint_interval;
425430

426431
// both were found
@@ -436,6 +441,8 @@ EControl pointsDetection(const pcl::PointCloud<pcl::PointXYZ>& points, const int
436441
}
437442
}
438443

444+
//主要功能是对pointsDetection()返回的EControl状态,除了显示障碍物的位置之外,还要进行一项特殊处理:
445+
//如果上一次检测发现了障碍无,但是最近一次检测没有障碍物,就等一下再走,以保证安全。
439446
EControl obstacleDetection(int closest_waypoint, const autoware_msgs::Lane& lane, const CrossWalk& crosswalk,
440447
const VelocitySetInfo vs_info, const ros::Publisher& detection_range_pub,
441448
const ros::Publisher& obstacle_pub, int* obstacle_waypoint)
@@ -480,6 +487,8 @@ EControl obstacleDetection(int closest_waypoint, const autoware_msgs::Lane& lane
480487
return detection_result;
481488
}
482489

490+
//根据obstacleDetection函数返回的EControl状态(如stop和decelerate状态),对当前位路径点和obstacle路径点之间的路径点的速度信息进行调整,
491+
//进而在pure_suit环节形成减速和停车现象
483492
void changeWaypoints(const VelocitySetInfo& vs_info, const EControl& detection_result, int closest_waypoint,
484493
int obstacle_waypoint, const ros::Publisher& final_waypoints_pub, VelocitySetPath* vs_path)
485494
{
@@ -593,10 +602,12 @@ int main(int argc, char** argv)
593602
crosswalk.setDetectionWaypoint(
594603
crosswalk.findClosestCrosswalk(closest_waypoint, vs_path.getPrevWaypoints(), STOP_SEARCH_DISTANCE));
595604

605+
//检测障碍物位于当前线路的索引值,并根据距离信息判断当前需要停车还是减速
596606
int obstacle_waypoint = -1;
597607
EControl detection_result = obstacleDetection(closest_waypoint, vs_path.getPrevWaypoints(), crosswalk, vs_info,
598608
detection_range_pub, obstacle_pub, &obstacle_waypoint);
599609

610+
//根据车辆需要的状态,修改后方waypoints中的速度信息,进而在pure_presuit节点形成减速或者停车的效果。
600611
changeWaypoints(vs_info, detection_result, closest_waypoint,
601612
obstacle_waypoint, final_waypoints_pub, &vs_path);
602613

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Cross CI workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
11+
build-cross:
12+
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
fail-fast: false
18+
19+
env:
20+
VCS_FILE: build_depends.repos
21+
ROS_DISTRO: melodic
22+
AUTOWARE_CROSS_TARGET_PLATFORM: generic-aarch64
23+
AUTOWARE_TARGET_ARCH: aarch64
24+
AUTOWARE_TOOLCHAIN_FILE_PATH: ${{ github.workspace }}/cross_toolchain.cmake
25+
AUTOWARE_SYSROOT: /sysroot/generic-aarch64
26+
27+
container:
28+
image: autoware/build:generic-aarch64-melodic-bleedingedge
29+
30+
steps:
31+
32+
- name: Checkout repo
33+
uses: actions/checkout@v2
34+
35+
- name: Build repo
36+
run: |
37+
mkdir -p src_tmp/ && mv `find -maxdepth 1 -not -name . -not -name src_tmp -not -name $VCS_FILE` src_tmp/ && mv src_tmp/ src/
38+
sudo apt-get update -qq && sudo apt-get install -y python3-vcstool gcc git wget
39+
wget https://raw.githubusercontent.com/Autoware-AI/docker/master/crossbuild/cross_toolchain.cmake
40+
vcs validate < $VCS_FILE
41+
vcs import src/ < $VCS_FILE
42+
bash -c 'source $AUTOWARE_SYSROOT/opt/ros/${ROS_DISTRO}/setup.bash; \
43+
colcon build --merge-install \
44+
--cmake-args \
45+
-DCMAKE_TOOLCHAIN_FILE=$AUTOWARE_TOOLCHAIN_FILE_PATH \
46+
-DCMAKE_SYSTEM_PROCESSOR=$AUTOWARE_TARGET_ARCH \
47+
-DCMAKE_PREFIX_PATH="$(pwd)/install;${AUTOWARE_SYSROOT}/opt/ros/${ROS_DISTRO}" \
48+
-DCMAKE_FIND_ROOT_PATH=$(pwd)/install/;'
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CUDA CI workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
11+
build-melodic:
12+
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest] #[ubuntu-latest, self-hosted]
17+
fail-fast: false
18+
19+
container:
20+
image: autoware/autoware:bleedingedge-melodic-base-cuda
21+
env:
22+
VCS_FILE: build_depends.repos
23+
ROS_DISTRO: melodic
24+
options: --user root
25+
26+
steps:
27+
28+
- name: Checkout repo
29+
uses: actions/checkout@v2
30+
31+
- name: Prepare repo
32+
run: |
33+
mkdir -p src_tmp/ && mv `find -maxdepth 1 -not -name . -not -name src_tmp -not -name $VCS_FILE` src_tmp/ && mv src_tmp/ src/
34+
vcs validate < $VCS_FILE
35+
vcs import src/ < $VCS_FILE
36+
rosdep update && apt-get update -qqq
37+
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
38+
mkdir -p depends_ws/src
39+
mv src/depends depends_ws/src
40+
41+
- name: Build depends repos
42+
run: |
43+
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
44+
cd depends_ws; colcon build; cd ..'
45+
46+
- name: Build and test repo
47+
run: |
48+
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
49+
source depends_ws/install/local_setup.bash; \
50+
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Debug; \
51+
colcon build --cmake-target tests --cmake-args -DCMAKE_BUILD_TYPE=Debug; \
52+
colcon test; \
53+
colcon test-result --verbose'
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Native CI workflow
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
11+
build-melodic:
12+
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest] #[ubuntu-latest, self-hosted]
17+
fail-fast: false
18+
19+
container:
20+
image: autoware/autoware:bleedingedge-melodic-base
21+
env:
22+
VCS_FILE: build_depends.repos
23+
ROS_DISTRO: melodic
24+
options: --user root
25+
26+
steps:
27+
28+
- name: Checkout repo
29+
uses: actions/checkout@v2
30+
31+
- name: Prepare repo
32+
run: |
33+
mkdir -p src_tmp/ && mv `find -maxdepth 1 -not -name . -not -name src_tmp -not -name $VCS_FILE` src_tmp/ && mv src_tmp/ src/
34+
vcs validate < $VCS_FILE
35+
vcs import src/ < $VCS_FILE
36+
rosdep update && apt-get update -qqq
37+
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
38+
mkdir -p depends_ws/src
39+
mv src/depends depends_ws/src
40+
41+
- name: Build depends repos
42+
run: |
43+
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
44+
cd depends_ws; colcon build; cd ..'
45+
46+
- name: Build and test repo
47+
run: |
48+
bash -c 'source /opt/ros/$ROS_DISTRO/setup.bash; \
49+
source depends_ws/install/local_setup.bash; \
50+
colcon build --cmake-args -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_BUILD_TYPE=Debug; \
51+
colcon build --cmake-target tests --cmake-args -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage" -DCMAKE_BUILD_TYPE=Debug; \
52+
lcov --initial --directory build --capture --output-file lcov.base; \
53+
colcon test; \
54+
colcon test-result --verbose; \
55+
lcov --directory build --capture --output-file lcov.test; \
56+
lcov -a lcov.base -a lcov.test -o lcov.total; \
57+
lcov -r lcov.total '*/tests/*' '*/test/*' '*/build/*' '*/devel/*' '*/install/*' '*/log/*' '*/usr/*' '*/opt/*' '/tmp/*' '*/CMakeCCompilerId.c' '*/CMakeCXXCompilerId.cpp' '*/depends_ws/*' -o lcov.total.filtered; \
58+
genhtml -p "$PWD" --legend --demangle-cpp lcov.total.filtered -o coverage; \
59+
tar -czvf coverage.tar.gz coverage'
60+
61+
- name: Upload Logs
62+
uses: actions/upload-artifact@v1
63+
with:
64+
name: coverage.tar.gz
65+
path: coverage.tar.gz
66+
if: always()

0 commit comments

Comments
 (0)