Skip to content

Commit

Permalink
finish reviewing sim_env
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhanyuGuo committed Jun 22, 2024
1 parent eb3e634 commit 624cfd4
Show file tree
Hide file tree
Showing 29 changed files with 444 additions and 441 deletions.
2 changes: 1 addition & 1 deletion src/sim_env/config/amcl_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ odom_model_type: "diff"
odom_alpha1: 0.1
odom_alpha2: 0.1
odom_alpha3: 0.1
odom_alpha4: 0.1
odom_alpha4: 0.1
43 changes: 22 additions & 21 deletions src/sim_env/config/costmap/global_costmap_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@ global_costmap:
update_frequency: 1.0
publish_frequency: 1.0
transform_tolerance: 0.5
cost_scaling_factor: 2.0
cost_scaling_factor: 2.0
inflation_radius: 0.8

### Sensor management parameters ###
obstacle_layer:
observation_sources: scan
scan: {
topic: scan,
sensor_frame: base_footprint,
observation_persistence: 0.0,
expected_update_rate: 0.8,
data_type: LaserScan,
clearing: true,
marking: true,
max_obstacle_height: 0.8,
min_obstacle_height: 0.0,
obstacle_range: 2.5,
raytrace_range: 3.0,
inf_is_valid: true
}
scan:
{
topic: scan,
sensor_frame: base_footprint,
observation_persistence: 0.0,
expected_update_rate: 0.8,
data_type: LaserScan,
clearing: true,
marking: true,
max_obstacle_height: 0.8,
min_obstacle_height: 0.0,
obstacle_range: 2.5,
raytrace_range: 3.0,
inf_is_valid: true,
}

inflation_layer:
enabled: true
cost_scaling_factor: 2.0 # exponential rate at which the obstacle cost drops off (default: 10)
inflation_radius: 0.8 # max. distance from an obstacle at which costs are incurred for planning paths.
enabled: true
cost_scaling_factor: 2.0 # exponential rate at which the obstacle cost drops off (default: 10)
inflation_radius: 0.8 # max. distance from an obstacle at which costs are incurred for planning paths.

static_map:
enabled: true
clear_time: 20
publish_static_map: true
enabled: true
clear_time: 20
publish_static_map: true
6 changes: 3 additions & 3 deletions src/sim_env/config/costmap/local_costmap_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ local_costmap:

update_frequency: 10.0
publish_frequency: 10.0
transform_tolerance: 0.5
transform_tolerance: 0.5

static_map: false
static_map: false
rolling_window: true
width: 3
height: 3
resolution: 0.05

inflation_radius: 3.0
inflation_radius: 3.0
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ cost_scaling_factor: 3.0

map_type: costmap
observation_sources: scan
scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true}
scan:
{
sensor_frame: base_scan,
data_type: LaserScan,
topic: scan,
marking: true,
clearing: true,
}
12 changes: 6 additions & 6 deletions src/sim_env/config/planner/apf_planner_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ APFPlanner:
min_w: 0.0
max_w_inc: 1.57

s_window: 5 # trajectory smoothing window time
s_window: 5 # trajectory smoothing window time

zeta: 1.0 # scale factor of attractive force
eta: 3.0 # scale factor of repulsive force
zeta: 1.0 # scale factor of attractive force
eta: 3.0 # scale factor of repulsive force

cost_ub: 254 # the upper bound of costmap used to calculate potential field
cost_lb: 0 # the lower bound of costmap used to calculate potential field
cost_ub: 254 # the upper bound of costmap used to calculate potential field
cost_lb: 0 # the lower bound of costmap used to calculate potential field

# the costmap inflation radius of obstacles
# this parameter should be consistent with that in sim_env/config/costmap/xxx_costmap_params.yaml
inflation_radius: 3.0

base_frame: base_link
map_frame: map
map_frame: map
23 changes: 11 additions & 12 deletions src/sim_env/config/planner/dwa_planner_params.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
DWAPlanner:

# Robot Configuration Parameters
# Robot Configuration Parameters
max_vel_x: 0.46
min_vel_x: 0.00

max_vel_y: 0.0
min_vel_y: 0.0

# The velocity when robot is moving in a straight line
max_vel_trans: 0.26
min_vel_trans: 0.13
# The velocity when robot is moving in a straight line
max_vel_trans: 0.26
min_vel_trans: 0.13

max_vel_theta: 1.82
min_vel_theta: 0.9

acc_lim_x: 2.5
acc_lim_y: 0.0
acc_lim_theta: 3.2
acc_lim_theta: 3.2

# Goal Tolerance Parameters
# Goal Tolerance Parameters
xy_goal_tolerance: 0.2
yaw_goal_tolerance: 0.5
latch_xy_goal_tolerance: false

# Forward Simulation Parameters
# Forward Simulation Parameters
sim_time: 2.0
vx_samples: 20
vy_samples: 0
vth_samples: 40
controller_frequency: 10.0

# Trajectory Scoring Parameters
# Trajectory Scoring Parameters
path_distance_bias: 32.0
goal_distance_bias: 20.0
occdist_scale: 0.02
Expand All @@ -39,9 +38,9 @@ DWAPlanner:
scaling_speed: 0.25
max_scaling_factor: 0.2

# Oscillation Prevention Parameters
# Oscillation Prevention Parameters
oscillation_reset_dist: 0.05

# Debugging
publish_traj_pc : true
# Debugging
publish_traj_pc: true
publish_cost_grid_pc: true
9 changes: 4 additions & 5 deletions src/sim_env/config/planner/evolutionary_planner_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EvolutionaryPlanner:
# whether publish expand zone or not
expand_zone: true

## Ant Colony Optimization(ACO) planner
## Ant Colony Optimization(ACO) planner
# number of ants
n_ants: 50
# number of inherited ants (Note: Need to be less than parameter ants)
Expand All @@ -32,7 +32,7 @@ EvolutionaryPlanner:
# maximum iterations
max_iter_ant: 5

## Particle Swarm Optimization(PSO) planner
## Particle Swarm Optimization(PSO) planner
# number of particles
n_particles: 50
# number of inherited particles (Note: Need to be less than parameter n_particles)
Expand All @@ -54,8 +54,7 @@ EvolutionaryPlanner:
# maximum iterations
max_iter_pso: 5


## Genetic Algorithm(GA) planner
## Genetic Algorithm(GA) planner
# number of genets (Note: The parameter must be set to an even number greater than 0)
n_genets: 50
# number of inherited genets (Note: Need to be less than parameter n_genets)
Expand All @@ -78,4 +77,4 @@ EvolutionaryPlanner:
# 2: Randomly generate initial genets swarm positions within the circular area of the starting and target points
init_mode_ga: 2
# maximum iterations
max_iter_ga: 5
max_iter_ga: 5
2 changes: 0 additions & 2 deletions src/sim_env/config/planner/rpp_planner_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ RPPPlanner:
scaling_gain: 1.0
approach_dist: 0.8
approach_min_v: 0.1


2 changes: 1 addition & 1 deletion src/sim_env/config/planner/sample_planner_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ SamplePlanner:
# parallel rewire process
rewire_threads_num: 4
# aggressive or gradual optimizing strategy
t_distr_freedom: 1.0 # suggest from 0.2 to 3
t_distr_freedom: 1.0 # suggest from 0.2 to 3
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ cost_scaling_factor: 3.0

map_type: costmap
observation_sources: scan
scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true}
scan:
{
sensor_frame: base_scan,
data_type: LaserScan,
topic: scan,
marking: true,
clearing: true,
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,12 @@ cost_scaling_factor: 3.0

map_type: costmap
observation_sources: scan
scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true, inf_is_valid: true}
scan:
{
sensor_frame: base_scan,
data_type: LaserScan,
topic: scan,
marking: true,
clearing: true,
inf_is_valid: true,
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ cost_scaling_factor: 3.0

map_type: costmap
observation_sources: scan
scan: {sensor_frame: base_scan, data_type: LaserScan, topic: scan, marking: true, clearing: true}
scan:
{
sensor_frame: base_scan,
data_type: LaserScan,
topic: scan,
marking: true,
clearing: true,
}
2 changes: 1 addition & 1 deletion src/sim_env/launch/main.launch
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<arg name="world" value="$(arg world_parameter)" />
<arg name="map" value="warehouse" />
<arg name="robot_number" value="1" />
<arg name="rviz_file" value="" />
<arg name="rviz_file" value="sim_env.rviz" />
</include>
</launch>
10 changes: 6 additions & 4 deletions src/sim_env/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<author email="[email protected]">Winter</author>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
Expand All @@ -19,19 +20,20 @@
<exec_depend>roscpp</exec_depend>
<exec_depend>rospy</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>gazebo_ros</exec_depend>
<exec_depend>rviz</exec_depend>

<exec_depend>controller_manager</exec_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>effort_controllers</exec_depend>
<exec_depend>gazebo_plugins</exec_depend>
<exec_depend>gazebo_ros</exec_depend>
<exec_depend>gazebo_ros_control</exec_depend>
<exec_depend>joint_state_controller</exec_depend>
<exec_depend>joint_state_publisher</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>yocs_cmd_vel_mux</exec_depend>
<exec_depend>message_runtime</exec_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>xacro</exec_depend>
<exec_depend>rviz</exec_depend>

<!-- The export tag contains other, unspecified, tags -->
<export>
Expand Down
42 changes: 21 additions & 21 deletions src/sim_env/urdf/nanocar/nanocar.gazebo.xacro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<robot name="NanoCar" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:arg name="robot_name" default=""/>
<xacro:arg name="robot_name" default="" />

<gazebo reference="base_link">
<material>Gazebo/DarkGrey</material>
Expand Down Expand Up @@ -38,7 +38,7 @@
<fdir1>1 0 0</fdir1>
<material>Gazebo/FlatBlack</material>
</gazebo>

<gazebo reference="back_right_wheel_link">
<mu1>0.5</mu1>
<mu2>0.5</mu2>
Expand Down Expand Up @@ -82,7 +82,7 @@
<gazebo>
<plugin name="imu_plugin" filename="libgazebo_ros_imu.so">
<alwaysOn>true</alwaysOn>
<bodyName>imu_link</bodyName>
<bodyName>imu_link</bodyName>
<frameName>imu</frameName>
<topicName>imu</topicName>
<serviceName>imu_service</serviceName>
Expand Down Expand Up @@ -141,22 +141,22 @@
</sensor>
</gazebo>


<gazebo reference="camera_rgb_frame">
<sensor type="depth" name="realsense_R200">
<always_on>true</always_on>
<visualize>$(arg camera_visual)</visualize>
<camera>
<horizontal_fov>1.085595</horizontal_fov>
<image>
<width>640</width>
<height>480</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.03</near>
<far>100</far>
</clip>
<horizontal_fov>1.085595</horizontal_fov>
<image>
<width>640</width>
<height>480</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.03</near>
<far>100</far>
</clip>
</camera>
<plugin name="camera_controller" filename="libgazebo_ros_openni_kinect.so">
<baseline>0.2</baseline>
Expand All @@ -170,12 +170,12 @@
<cameraInfoTopicName>rgb/camera_info</cameraInfoTopicName>
<depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
<pointCloudCutoff>0.4</pointCloudCutoff>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
<CxPrime>0.0</CxPrime>
<Cx>0.0</Cx>
<Cy>0.0</Cy>
Expand All @@ -184,4 +184,4 @@
</plugin>
</sensor>
</gazebo>
</robot>
</robot>
Loading

0 comments on commit 624cfd4

Please sign in to comment.