@danren-aa120
2020-08-24T07:37:48.000000Z
字数 8365
阅读 419
ROS
1.车启动时原地旋转的问题:将min_in_place_vel_theta减小到(0.05)
2.planner_frequency降低点能控制车在行驶过程中左右晃动(0.5)
3.cost=CONST_NEUTRAL+COST_FACTOR*const_cost_value.
输入的地图代价地图的cost的值是0~252.当COST_NEUTRAL 是50 这个COST_FACTOR大约在0.8来确认这个输入的值,所以就是50~253.如果 这个COST_FACTOR高的话,那么cost,将会很高,在遇到障碍物的时候,总之就是不好。通过实验观测,我们发现:当cost_factor=0.55 neutral_cost=66. lethal_cost=253,这个时候的全局的路径规划效果是最好的。
4.应该激光雷达的扫描的分辨率,如果想要的得到的地图的分辨率大于激光雷达的分辨率,那么就会出现一些 UNKNOW的点
5.max obstacle height 插入的障碍物的最大高度(米),这个参数应该设置的略微比你的机器人高。
ROS Navigation Tuning Guide阅读笔记
1 Velocity and Acceleration
In ROS navigation If you can control your robot manually (e.g. with a joystick), you can try to run it forward until its speed reaches constant, and then echo the odometry data.
To obtain maximum rotational velocity, we can control the robot by a joystick and rotate the robot 360 degrees after the robot’s speed reaches constant, and time this movement。
- 1.2 To obtain maximum acceleration
- 1.3 Setting minimum values
For minimum translational velocity, we want to set it to a large negative value because this enables the robot to back off when it needs to unstuck itself, but it should prefer moving forward in most cases. For minimum rotational velocity, we also want to set it to negative (if the parameter allows) so that the robot can rotate in either directions. Notice that DWA Local Planner takes the absolute value of robot’s minimum rotational velocity.
2 Global Planner
2.1 Global Planner Selection
There are three global planners that adhere to nav core::BaseGlobal Planner interface: carrot planner, navfn and global planner.
2.2 Global Planner Parameters
not all of these parameters are listed on ROS’s website, but you can see them if you run the rqt dynamic reconfigure program with:
rosrun rqt reconfigure rqt reconfigure
We can leave allow unknown(true), use dijkstra(true), use quadratic(true), use grid path(false), old navfn behavior(false) to their default values. Setting visualize potential(false) to true is helpful when we would like to visualize the potential map in RVIZ.
With COST NEUTRAL of 50, the COST FACTOR needs to be about 0.8 to ensure the input values are spread evenly over the output range, 50 to 253. If COST FACTOR is higher, cost values will have a plateau around obstacles and the planner will then treat (for example) the whole width of a narrow hallway as equally undesirable and thus will not plan paths down the center.
3 Local Planner Selection
-------3.1.1 DWA algorithm
This DWA planner depends on the local costmap which provides obstacle information. Therefore, tuning the parameters for the local costmap is crucial for optimal
behavior of DWA local planner. Next, we will look at parameters in forward simulation, trajectory scoring, costmap, and so on.
-------3.1.2 DWA Local Planner : Forward Simulati
Through experiments, we observed that the longer the value of sim time, the heavier the computation load becomes. Also, when sim time gets longer, the path produced by the local planner is longer as well, which is reasonable. Here are some suggestions on how to tune this sim time parameter.
How to tune sim time Setting sim time to a very low value (<= 2.0) will result
in limited performance, especially when the robot needs to pass a narrow doorway,
or gap between furnitures, because there is insufficient time to obtain the optimal
trajectory that actually goes through the narrow passway. On the other hand, since
with DWA Local Planner, all trajectories are simple arcs, setting the sim time to a
very high value (>= 5.0) will result in long curves that are not very flexible. This
problem is not that unavoidable, because the planner actively replans after each time
interval (controlled by controller frequency(Hz)), which leaves room for small
adjustments. A value of 4.0 seconds should be enough even for high performance
computers.
Velocity samples The number of samples you would like to take depends on how much computation power you have. In most cases we prefer to set vth samples to be higher than translational velocity samples, because turning is generally a more complicated condition than moving straight ahead.
Simulation granularity sim granularity is the step size to take between points
on a trajectory. It basically means how frequent should the points on this trajectory
be examined (test if they intersect with any obstacle or not). A lower value means
higher frequency, which requires more computation power. The default value of 0.025
is generally enough for turtlebot-sized mobile base.//但不用heading_scoring即为false时,它代表点之间的距离
3.1.3 DWA Local Planner : Trajactory Scoring
The objective is to get the lowest cost. path_distance_bias is the weight for how
much the local planner should stay close to the global path [Furrer et al., 2016]. A
high value will make the local planner prefer trajectories on global path.
goal distance_bias is the weight for how much the robot should attempt to
reach the local goal, with whatever path. Experiments show that increasing this
parameter enables the robot to be less attached to the global path.
occdist scale is the weight for how much the robot should attempt to avoid obstacles. A high value for this parameter results in indecisive robot that stucks in place.
Currently for SCITOS G5, we set path distance bias to 32.0, goal distance bias
to 20.0, occdist scale to 0.02. They work well in simulation.
4 Costmap Parameters
Static map layer directly interprets the given static SLAM map provided to the navigation stack. Obstacle map layer includes 2D obstacles and 3D obstacles (voxel layer). Inflation layer is where obstacles are inflated to calculate cost for each 2D costmap cell.
inflation radius and cost scaling factor are the parameters that determine the inflation. inflation radius controls how far away the zero cost point is from the obstacle. cost scaling factor is inversely proportional to the cost of a cell. Setting it higher will make the decay curve more steep.
Dr. Pronobis sugggests the optimal costmap decay curve is one that has relatively low slope, so that the best path is as far as possible from the obstacles on each side. The advantage is that the robot would prefer to move in the middle of obstacles. When costmap curve is steep, the robot tends to be close to obstacles. Based on the decay curve diagram, we want to set these two parameters such that the inflation radius almost covers the corriders, and the decay of cost value is moderate, which means decrease the value of cost scaling factor .
4.2 costmap resolution
This parameter can be set separately for local costmap and global costmap. They affect computation load and path planning. With low resolution, in narrow passways, the obstacle region may overlap and thus the local planner will not be able to find a path through.
For global costmap resolution, it is enough to keep it the same as the resolution of the map provided to navigation stack. If you have more than enough computation power, you should take a look at the resolution of your laser scanner, because when creating the map using gmapping, if the laser scanner has lower resolution than your desired map resolution, there will be a lot of small ”unknown dots” because the laser scanner cannot cover that area.//必须大于激光雷达的分辨率,这两段说明全局地图分辨率不能太大也不能太小。
4.3 obstacle layer and voxel layer
In ROS implementation, the voxel layer inherits from obstacle layer, and they both obtain obstacles information by interpreting laser scans or data sent with PointCloud or PointCloud2 type messages. //也就是说,全局地图设置中的obstacle layer中的参数也要考虑设置
With ray tracing, laser scanners is able to recognize different types of obstacles:
• max obstacle height: The maximum height of any obstacle to be inserted into
the costmap in meters. This parameter should be set to be slightly higher than
the height of your robot. For voxel layer, this is basically the height of the voxel
grid.
• obstacle range: The default maximum distance from the robot at which an
obstacle will be inserted into the cost map in meters. This can be over-ridden
on a per-sensor basis.
• raytrace range: The default range in meters at which to raytrace out obstacles
from the map using sensor data. This can be over-ridden on a per-sensor basis.
These parameters are only used for the voxel layer (VoxelCostmapPlugin).
• origin z: The z origin of the map in meters.
• z resolution: The z resolution of the map in meters/cell.
• z voxels: The number of voxels to in each vertical column, the height of the
grid is z resolution * z voxels.
• unknown threshold: The number of unknown cells allowed in a column considered to be ”known”
• mark threshold: The maximum number of marked cells allowed in a column considered to be ”free
如果将z分辨率设置为较高的值,则您的目的应该是更好地获得障碍物,因此您需要增加z体素参数,该参数控制每个垂直列中有多少个体素。 如果列中的体素过多但分辨率不足,这也将无用,因为每个垂直列都有高度限制。
5 Recovery Behaviors
An annoying thing about robot navigation is that the robot may get stuck.
In most experiments we observed that when the robot gives up, there are actually many ways to unstuck the robot. To avoid giving up, we used SMACH to continuously try different recovery behaviors, with additional ones such as setting a temporary goal that is very close to the robot, and returning to some previously visited pose (i.e. backing off). These methods turn out to improve the robot’s durability substantially, and unstuck it from previously hopeless tight spaces from our experiment observations
For clear costmap recovery, if you have a relatively high sim time, which means the trajectory is long, you may want to consider increasing conserve reset distance parameter, so that bigger area on local costmap is removed, and there is a better chance for the local planner to find a path.