Commit abc03417 authored by czb5793's avatar czb5793
Browse files

Small change

parent 4b4d3ee9
......@@ -34,9 +34,9 @@ robot:
motor:
noise:
# Standard deviation of the left wheel's velocity in meters/second while executing a motion command.
left_velocity: 0.001 # 0.0001
left_velocity: 0.01 # 0.0001
# Standard deviation of the right wheel's velocity in meters/second while executing a motion command.
right_velocity: 0.001 # 0.0001
right_velocity: 0.01 # 0.0001
# Configures the sensors used by the robot
sensor:
......@@ -140,10 +140,10 @@ control:
# If robot is closer than this distance to the goal, it is considered as reached
goal_reached_distance: 0.05
# If a sensor measures a distance smaller than the danger distance, the robot immediately starts moving into the opposite direction
danger_distance: 0.06
danger_distance: 0.04 # 0.06
# If a sensor measures a distance smaller than the caution distance, the robot will follow the wall of the obstacle
# Set to danger_distance to disable wall following, since the map contains small, circle-like objects, where wall following can lead to looping around an object
caution_distance: 0.8 # 0.06
caution_distance: 0.15 # 0.06
# Criterion for stopping the following of a wall
progress_epsilon: 0.05 # 0.05
......@@ -169,7 +169,7 @@ slam:
detected_angle: 30
ekf_slam:
# Determines whether the EKF SLAM algorithm shall be executed
enabled: ture
enabled: false
# The mahalanobis distance threshold used in data association
distance_threshold: 1
# Configures the motion noise. The values are currently empirically chosen.
......@@ -182,7 +182,7 @@ slam:
theta: 1
fast_slam:
# Determines whether the FastSLAM algorithm shall be executed
enabled: true
enabled: false
# The mahalanobis distance threshold used in data association
distance_threshold: 0.125
# The number of used particles
......@@ -196,13 +196,17 @@ slam:
graph_based_slam:
# Determines whether the Graph-based SLAM algorithm shall be executed
enabled: true
# The euclidean distance threshold used in data association
distance_threshold: 0.125
enabled: false
# The euclidean distance threshold [m] used in data association.
# If the distance between the estimated landmarks via slam and via actual measurement
# larger than the threshold, start backend
distance_threshold: 0.2
# The number interval of pose-vertices added that the graph optimization is executed.
optimization_interval: 20
optimization_interval: 50
# The timestep interval of executing the frontend part.
frontend_interval: 5
# Vertex density of frontend. minimum distance [m] between the current pose and the last pose.
frontend_density: 0.1
# Configures the motion noise. The values are currently empirically chosen.
motion_noise:
# Standard deviation of the robots x-coordinate in meters after executing a motion command.
......@@ -221,7 +225,7 @@ slam:
# Configures the evaluation of the SLAM algorithms
evaluation:
# Determines whether the accuracy of the generated maps shall be evaluated
enabled: true
enabled: True
# Determines the interval of when the accuracy of the generated maps is calculated
# A low interval (for example 1) causes performance problems
interval: 18
......@@ -239,14 +243,8 @@ slam:
width: 5
# Height of the map in meters
height: 6
# Number of pixels per meter. The GUI has problem while using grid map of high resolution.
# Number of grids per meter. Note that high resolution will lead to performance issues.
resolution: 20
# offset the origin in the grid map
offset:
# offset in meters in horizontal direction
x: 2.5
# offset in meters in vertical direction
y: 3
path_planning:
# Determines whether the path planning algorithm shall be executed
......
......@@ -19,9 +19,13 @@ It is recommended to run the simulator directly on your native machine. For this
- Python 3: Please follow the instructions at http://www.python.org/download/
- PyGTK 3: Please follow the instructions at https://pygobject.readthedocs.io/en/latest/getting_started.html
An additional dependency (see [scikit-sparse](https://scikit-sparse.readthedocs.io/en/latest/overview.html)) is required:
sudo apt-get install libsuitesparse-dev
Additional dependencies can then be installed using `pip`
pip3 install matplotlib numpy scipy
pip3 install matplotlib numpy scipy pandas
pip3 install pyyaml
The simulator is then started by
......
......@@ -97,6 +97,8 @@ class Simulator:
Initializes the simulated world
:param random: Boolean value specifying if a random map shall be generated
"""
# reset the simulation cycles
self.num_cycles = 0
# reset the viewer
self.viewer.control_panel_state_init()
......@@ -144,10 +146,19 @@ class Simulator:
# register slam estimations to the system
self.reg_slam_evaluations = [self.ekfslam_evaluation, self.fastslam_evaluation, self.graphbasedslam_evaluation]
self.slam_evaluation = None
if self.cfg["slam"]["evaluation"]["enabled"]:
list_slam = [self.world.supervisors[0].ekfslam, self.world.supervisors[0].fastslam, self.world.supervisors[0].graphbasedslam]
self.slam_evaluations = SlamEvaluation2(list_slam,
self.cfg["slam"]["evaluation"], self.world.robots[0])
self.slam_evaluation = SlamEvaluation2(list_slam,
self.cfg["slam"]["evaluation"], self.world.robots[0])
for slam in list_slam:
if slam is not None:
slam.callback = self.slam_evaluation.time_per_step # set the callback function
list_mapping = [self.world.supervisors[0].ekfslam_mapping, self.world.supervisors[0].fastslam_mapping,
self.world.supervisors[0].graphbasedslam_mapping]
for mapping in list_mapping:
if mapping is not None:
mapping.callback = self.slam_evaluation.time_per_step # set the callback function
# render the initial world
self.draw_world()
......@@ -190,6 +201,9 @@ class Simulator:
self.pause_sim()
self.initialize_sim()
if self.slam_evaluation is not None:
self.slam_evaluation.reset_record()
def save_map(self, filename):
"""
Save the map
......@@ -234,8 +248,12 @@ class Simulator:
def _update_slam_accuracies(self):
# Only perform the SLAM evaluation on specific simulation cycles. The period is configurable.
if self.num_cycles % self.cfg["slam"]["evaluation"]["interval"] == 0:
self.slam_evaluations.evaluate(self.world.obstacles)
if self.num_cycles % self.cfg["slam"]["evaluation"]["interval"] == 0 \
and self.slam_evaluation is not None:
self.slam_evaluation.evaluate(self.world.obstacles)
# record data on each the simulation cycles
if self.slam_evaluation is not None:
self.slam_evaluation.record(self.num_cycles, self.world.obstacles)
def _step_sim(self):
self.num_cycles += 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment