Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
487 changes: 295 additions & 192 deletions ROSNavBench/benchmarking_local_global_planners_pdf.py

Large diffs are not rendered by default.

533 changes: 0 additions & 533 deletions ROSNavBench/benchmarking_single_controller.py

This file was deleted.

2 changes: 1 addition & 1 deletion ROSNavBench/marker_publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main(args=None):
marker.pose.orientation.z = 0.0
marker.pose.orientation.w = 1.0
if os.environ["controller"]!= None:
marker.text=os.environ["controller"]+"\n"+os.environ["planner"]
marker.text=os.environ["controller"]+"\n"+os.environ["planner"]+" "+os.environ["round_num"]
else:
marker.text='None'
for i in range(4):
Expand Down
45 changes: 32 additions & 13 deletions ROSNavBench/performace_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,21 @@
# success rate will be provided on seperate analysis

#Data will be recived as a table of data [[name of critera as in table],[1m,1,1,1,]]
analysis_data=[[['Controller\ntype', 'Success\n rate\n (%)', 'Average \nexecution\ntime (sec)', 'CPU(%)', '', 'Memory usage(%)', 'Memory usage (%)', 'Average\nnumber of\nrecoveries', 'Average\n path\nlength(m)', 'Min\nproximity to\n obstacles(m)'],
['', '', '', 'Average', 'Max', 'Average', 'Max', '', '', ''],
['RPP', '100.0', '17.53', '21.21', '25.2', '10.56', '10.6', '0.00', '3.13', '0.58'],
['DWB', '100.0', '17.87', '20.36', '24.9', '10.60', '10.6', '0.00', '3.15', '0.58']],
[['Controller\ntype', 'Success\n rate\n (%)', 'Average \nexecution\ntime (sec)', 'CPU(%)', '', 'Memory usage(%)', 'Memory usage (%)', 'Average\nnumber of\nrecoveries', 'Average\n path\nlength(m)', 'Min\nproximity to\n obstacles(m)'],
['', '', '', 'Average', 'Max', 'Average', 'Max', '', '', ''],
['RPP', '100.0', '16.82', '18.93', '22.9', '10.60', '10.6', '0.00', '3.08', '0.53'],
['DWB', '100.0', '17.90', '19.75', '25.8', '10.68', '10.7', '0.00', '3.11', '0.52']]]
criteria= ["Time", "Path Length", "CPU", "Memory", "Safety"]
planner_type= ["NavFn", "smac_planner"]
controller_type= ["RPP", "DWB"]

def performance_analysis(criteria,data,weights,planner_type,controller_type):
data,combinations,iterations_result=extract_data(criteria,data,planner_type,controller_type)
print(data)
if weights=='None':
#The user have not spceified weights
normalized_weights=assign_weight(criteria)
Expand Down Expand Up @@ -47,7 +59,7 @@ def extract_data(criteria, data,planner_type,controller_type):
iteration=len(controller_type)*i+j
combinations[iteration]+=" "+planner_type[i]

iterations_results=[inner_list[1] for outer_list in data for inner_list in outer_list[2:]]
iterations_results=[float(inner_list[1]) for outer_list in data for inner_list in outer_list[2:]]
for i in range(len(criteria)):
if criteria[i]=="Time":
arranged_data.append([float(inner_list[2]) for outer_list in data for inner_list in outer_list[2:]])
Expand Down Expand Up @@ -87,6 +99,7 @@ def assign_weight(criteria_order):
# Normalize the weights
total_weight = sum(weights.values())
normalized_weights = {criterion: weight / total_weight for criterion, weight in weights.items()}
normalized_weights

return normalized_weights

Expand All @@ -105,14 +118,14 @@ def normalizing_data(data):

if not identical_element(data[i+1]):
for j in range(len(data[i+1])):
if data[0][i]=="Safety":
data[i+1][j]=(data[i+1][j]-min_value[i])/(max_value[i]-min_value[i])
else:
data[i+1][j]=(max_value[i]-data[i+1][j])/(max_value[i]-min_value[i])
#if data[0][i]=="Safety":
# data[i+1][j]=(data[i+1][j]-min_value[i])/(max_value[i]-min_value[i])
#else:
data[i+1][j]=(max_value[i]-data[i+1][j])/(max_value[i]-min_value[i])
else:
# if all values of a criterion are identical , set all of them to zero as they are not going to affect the final result
data[i+1]=[0]*len(data[i+1])

print("metric data",data)
return data

def identical_element(array):
Expand All @@ -125,14 +138,18 @@ def identical_element(array):
def rank(normailzed_data,weights,combinations,results):
for i in range(len(normailzed_data[0])):
for j in range(len(normailzed_data[i+1])):
normailzed_data[i+1][j]=round(normailzed_data[i+1][j]*weights[normailzed_data[0][i]],4)

if normailzed_data[0][i]=="Safety":

normailzed_data[i+1][j]=normailzed_data[i+1][j]*(-1)*weights[normailzed_data[0][i]]
else:
normailzed_data[i+1][j]=normailzed_data[i+1][j]*weights[normailzed_data[0][i]]


ranking=[]
for j in range(len(normailzed_data[1])):
ranking.append(sum([sublist[j] for sublist in normailzed_data[1:]]))

ranking.append(round(sum([sublist[j] for sublist in normailzed_data[1:]]),2))
for i in range(len(results)-1,-1,-1):
if results[i]!='succeeded':
if results[i]==0.0:
del combinations[i]
del ranking[i]
ranking=dict(zip(combinations,ranking))
Expand Down Expand Up @@ -164,7 +181,7 @@ def success_rate(result,controller_type,planner_type):
controllers=[]
planners=[]
for i in range(len(planner_type)):
planners.append("The success rate of "+planner_type[i]+" is "+str(round((result[i*len(controller_type):((i+1)*len(controller_type))].count('succeeded')/len(controller_type))*100,2))+" %")
planners.append("The success rate of "+planner_type[i]+" is "+str(round((sum(result[i*len(controller_type):((i+1)*len(controller_type))])/len(controller_type)),2))+" %")
for i in range(len(controller_type)):
controllers.append([])
for i in range(len(controller_type)):
Expand All @@ -173,7 +190,9 @@ def success_rate(result,controller_type,planner_type):
controllers[i].append(result[j*len(controller_type)+i])

for i in range(len(controllers)):
controllers[i]="The success rate of "+controller_type[i]+" is "+str(round((controllers[i].count('succeeded')/len(planner_type))*100,2))+" %"
controllers[i]="The success rate of "+controller_type[i]+" is "+str(round((sum(controllers[i])/len(planner_type)),2))+" %"
return planners,controllers


ranking,planners_success_rate,controllers_success_rate=performance_analysis(criteria,analysis_data,'None',planner_type,controller_type)
print(ranking)
35 changes: 18 additions & 17 deletions config/circle_path_scenario.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,46 @@
experiment_name: "circular_path_scenario_two_controllers"

#Save directory of results
results_directory: "/home/riotu/ros2_ws2/src/ROSNavBench/results"
results_directory: "/home/riotu/ros5_ws/src/ROSNavBench/results"

# Add the absolute path of the world
world_path: "/home/riotu/ros2_ws2/src/ROSNavBench/simulations/worlds/scenario_world.world"
world_path: "/home/riotu/industrial_warehouse.world"

# Add the absolute path of the map
map_path: "/home/riotu/ros2_ws2/src/ROSNavBench/simulations/maps/map.yaml"
map_path: "/home/riotu/ros5_ws/src/ROSNavBench/simulations/maps/warehouse_slam_toolbox.yaml"

# Add the absolute path of the map
map_png_path: "/home/riotu/ros2_ws2/src/ROSNavBench/simulations/maps/map.pgm"
map_png_path: "/home/riotu/ros5_ws/src/ROSNavBench/simulations/maps/warehouse_slam_toolbox.pgm"

# Add gazebo model path, if multiple path, please spereate them by a :
models_path: "/opt/ros/humble/share/turtlebot3_gazebo/models:/home/riotu/ros2_ws2/src/ROSNavBench/simulations/models"
models_path: "/opt/ros/humble/share/turtlebot3_gazebo/models:/home/riotu/ros5_ws/src/ROSNavBench/simulations/models"

# Choose a type of global local planners to be tested
planner_type: ["NavFn", "smac_planner"]
planner_type: ["NavFn"]
# Choose one of the following controllers, by adding its name to the controller type list
# Note that these are the avaible controllers for the provided example
# DWB
# RPP
# RPP_RSC
# DWB_RSC
controller_type: ["RPP", "DWB", "MPPI"] #name of behaviour tree
controller_type: ["RPP"] #name of behaviour tree

# This option is intended for testing the same controller several times
# if the user do not need this test, set it to zero
trails_num: 0
# This option is intended for testing the same controller and planner combination several times
# Min value is one
instances_num: 1

# Add the absolute path of the robot navigation configuration
nav_config: "/home/riotu/perform_ws/src/ROSNavBench/example/turtlebot3/nav2_config/waffle.yaml"
nav_config: "/home/riotu/ros5_ws/src/ROSNavBench/example/turtlebot3/nav2_config/waffle_pi.yaml"

# Add the directory of the behaviour tree
behaviour_tree_directory: "/home/riotu/perform_ws/src/ROSNavBench/example/turtlebot3/behavior_trees"
behaviour_tree_directory: "/home/riotu/ros5_ws/src/ROSNavBench/example/turtlebot3/behavior_trees"

# Add the absolute path of the urdf and model files inside single qoutes ''
urdf_file: "/opt/ros/humble/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf"
urdf_file: "/opt/ros/humble/share/turtlebot3_description/urdf/turtlebot3_waffle_pi.urdf"

# If the robot is spawned by only urdf, then set the model_file to 'None'
model_file: "/opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf"
model_file: "/opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf"

#Citeria for performace analysis includes: "Time" ,"CPU", "Memory", "Path Length" , "Safety"
criteria: ["Time", "Path Length", "CPU", "Memory", "Safety"]

Expand All @@ -49,13 +50,13 @@ criteria: ["Time", "Path Length", "CPU", "Memory", "Safety"]
weights: "None"

# Provide the pose in a decimal form
spawn_pose_x: 4.0
spawn_pose_y: -3.0
spawn_pose_x: -1.25
spawn_pose_y: -2.40
spawn_pose_yaw: -3.13 #radians

# Specify either to send one goal, specific trajectory, or several waypoints
# square, circle, several_waypoints, one_goal
trajectory_type: "circle"

# Circule parameter, note that the place of spawn will be the center of the circle
radius: 1.1
radius: 2.0
45 changes: 23 additions & 22 deletions config/narrow_path.yaml → config/differen_tunning_DWB.yaml
Original file line number Diff line number Diff line change
@@ -1,63 +1,64 @@
# Name the experiment. This name will be the name of the report
experiment_name: "narrow_path_scenario_report"
experiment_name: "DWB_tuning"

#Save directory of results
results_directory: "/home/riotu/perform_ws/src/ROSNavBench/results"
results_directory: "/home/riotu/ros5_ws/src/ROSNavBench/results"

# Add the absolute path of the world
world_path: "/home/riotu/perform_ws/src/ROSNavBench/simulations/worlds/new_dynamic.world"
world_path: "/home/riotu/industrial_warehouse.world"

# Add the absolute path of the map
map_path: "/home/riotu/perform_ws/src/ROSNavBench/simulations/maps/map.yaml"
map_path: "/home/riotu/ros5_ws/src/ROSNavBench/simulations/maps/warehouse_slam_toolbox.yaml"

# Add the absolute path of the map
map_png_path: "/home/riotu/perform_ws/src/ROSNavBench/simulations/maps/map.pgm"
map_png_path: "/home/riotu/ros5_ws/src/ROSNavBench/simulations/maps/warehouse_slam_toolbox.pgm"

# Add gazebo model path, if multiple path, please spereate them by a :
models_path: "/opt/ros/humble/share/turtlebot3_gazebo/models:/home/riotu/perform_ws/src/ROSNavBench/simulations/models"
models_path: "/opt/ros/humble/share/turtlebot3_gazebo/models:/home/riotu/ros5_ws/src/ROSNavBench/simulations/models"

# Choose a type of global local planners to be tested
planner_type: ["NavFn", "smac_planner"]
planner_type: ["NavFn"]
# Choose one of the following controllers, by adding its name to the controller type list
# Note that these are the avaible controllers for the provided example
# DWB
# RPP
# RPP_RSC
# DWB_RSC
controller_type: ["RPP", "DWB", "MPPI"] #name of behaviour tree
controller_type: ["DWB","DWB_1","DWB_2"] #name of behaviour tree

# This option is intended for testing the same controller several times
# if the user do not need this test, set it to zero
trails_num: 0
# This option is intended for testing the same controller and planner combination several times
# Min value is one
instances_num: 1

# Add the absolute path of the robot navigation configuration
nav_config: "/home/riotu/perform_ws/src/ROSNavBench/example/turtlebot3/nav2_config/waffle.yaml"
nav_config: "/home/riotu/ros5_ws/src/ROSNavBench/example/turtlebot3/nav2_config/waffle_pi.yaml"

# Add the directory of the behaviour tree
behaviour_tree_directory: "/home/riotu/perform_ws/src/ROSNavBench/example/turtlebot3/behavior_trees"
behaviour_tree_directory: "/home/riotu/ros5_ws/src/ROSNavBench/example/turtlebot3/behavior_trees"

# Add the absolute path of the urdf and model files inside single qoutes ''
urdf_file: "/opt/ros/humble/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf"
urdf_file: "/opt/ros/humble/share/turtlebot3_description/urdf/turtlebot3_waffle_pi.urdf"

# If the robot is spawned by only urdf, then set the model_file to 'None'
model_file: "/opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf"
model_file: "/opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf"

#Citeria for performace analysis includes: "Time" ,"CPU", "Memory", "Path Length" , "Safety"
criteria: ["Time", "Path Length", "CPU", "Memory", "Safety"]
criteria: ["Time", "CPU"]

#Wieght for each criteria as a number from 1 to 9
#Set None if the wieght to be set automatcally giving that the importance to the eariler criteria in the matrix
weights: "None"

# Provide the pose in a decimal form
spawn_pose_x: 7.67
spawn_pose_y: 6.22
spawn_pose_x: 1.57
spawn_pose_y: 8.66
spawn_pose_yaw: -3.13 #radians

# Specify either to send one goal, specific trajectory, or several waypoints
# square, circle, several_waypoints, one_goal
trajectory_type: "one_goal"

# One goal parameter
goal_pose_x: 4.00
goal_pose_y: 6.22
goal_pose_yaw: -3.13 #radians
goal_pose_x: -3.86
goal_pose_y: 4.29
goal_pose_yaw: 2.58 #radians

67 changes: 0 additions & 67 deletions config/dynamic_obstacles.yaml

This file was deleted.

24 changes: 12 additions & 12 deletions config/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
experiment_name: "param_guide"

#Save directory of results
results_directory: "/home/riotu/ros2_ws2/src/ROSNavBench/results"
results_directory: "/home/riotu/ros_ws/src/ROSNavBench/results"

# Add the absolute path of the world
world_path: "/home/riotu/ros2_ws2/src/ROSNavBench/simulations/worlds/scenario_world.world"
world_path: "/home/riotu/ros_ws/src/ROSNavBench/simulations/worlds/scenario_world.world"

# Add the absolute path of the map
map_path: "/home/riotu/ros2_ws2/src/ROSNavBench/simulations/maps/map.yaml"
map_path: "/home/riotu/ros_ws/src/ROSNavBench/simulations/maps/map.yaml"

# Add the absolute path of the map
map_png_path: "/home/riotu/ros2_ws2/src/ROSNavBench/simulations/maps/map.pgm"
map_png_path: "/home/riotu/ros_ws/src/ROSNavBench/simulations/maps/map.pgm"

# Add gazebo model path, if multiple path, please spereate them by a :
models_path: "/opt/ros/humble/share/turtlebot3_gazebo/models:/home/riotu/ros2_ws2/src/ROSNavBench/simulations/models"
models_path: "/opt/ros/humble/share/turtlebot3_gazebo/models:/home/riotu/ros_ws/src/ROSNavBench/simulations/models"

# Choose a type of global local planners to be tested
planner_type: ["NavFn", "smac_planner"]
Expand All @@ -26,21 +26,21 @@ planner_type: ["NavFn", "smac_planner"]
# DWB_RSC
controller_type: ["RPP", "DWB", "MPPI"] #name of behaviour tree

# This option is intended for testing the same controller several times
# if the user do not need this test, set it to zero
trails_num: 0
# This option is intended for testing the same controller and planner combination several times
# Min value is one
instances_num: 1

# Add the absolute path of the robot navigation configuration
nav_config: "/home/riotu/perform_ws/src/ROSNavBench/example/turtlebot3/nav2_config/waffle.yaml"
nav_config: "/home/riotu/ros_ws/src/ROSNavBench/example/turtlebot3/nav2_config/waffle_pi.yaml"

# Add the directory of the behaviour tree
behaviour_tree_directory: "/home/riotu/perform_ws/src/ROSNavBench/example/turtlebot3/behavior_trees"
behaviour_tree_directory: "/home/riotu/ros_ws/src/ROSNavBench/example/turtlebot3/behavior_trees"

# Add the absolute path of the urdf and model files inside single qoutes ''
urdf_file: "/opt/ros/humble/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf"
urdf_file: "/opt/ros/humble/share/turtlebot3_description/urdf/turtlebot3_waffle_pi.urdf"

# If the robot is spawned by only urdf, then set the model_file to 'None'
model_file: "/opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle/model.sdf"
model_file: "/opt/ros/humble/share/turtlebot3_gazebo/models/turtlebot3_waffle_pi/model.sdf"
#Citeria for performace analysis includes: "Time" ,"CPU", "Memory", "Path Length" , "Safety"
criteria: ["Time", "Path Length", "CPU", "Memory", "Safety"]

Expand Down
Loading