Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkrawczyk committed Feb 10, 2020
0 parents commit 438d00a
Show file tree
Hide file tree
Showing 42 changed files with 24,292 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vscode/c_cpp_properties.json
.vscode/settings.json
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 2.8.3)
project(multiple_rosbots_simulation)




18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# Documentation

Documentation is at https://husarion.com/tutorials/ros-projects/security-guard-robot/


![rosbot_how_it_works_v2](https://user-images.githubusercontent.com/29305346/62467724-b454a600-b794-11e9-9923-efb211826750.png)
## Introduction

This ROS metapackage provides code needed to perform patrol task by rosbot (simulation) platform

I recommend to do all [ROS tutorials](https://husarion.com/tutorials/ros-tutorials/1-ros-introduction/) before doing this project

## Example usage

`roslaunch rosbot_patrol_simulation rosbot_patrol.launch`


10 changes: 10 additions & 0 deletions config/costmap_common_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map
robot_base_frame: base_link
always_send_full_costmap: true
10 changes: 10 additions & 0 deletions config/costmap_common_params_rosbot1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /rosbot1/scan, marking: true, clearing: true}
global_frame: map
robot_base_frame: /rosbot1/base_link
always_send_full_costmap: true
10 changes: 10 additions & 0 deletions config/costmap_common_params_rosbot2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: /rosbot2/scan, marking: true, clearing: true}
global_frame: map
robot_base_frame: /rosbot2/base_link
always_send_full_costmap: true
33 changes: 33 additions & 0 deletions config/darknet_config_simulation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
subscribers:

camera_reading:
topic: /camera/rgb/image_raw
queue_size: 1

actions:

camera_reading:
name: /darknet_ros/check_for_objects

publishers:

object_detector:
topic: /darknet_ros/found_object
queue_size: 1
latch: false

bounding_boxes:
topic: /darknet_ros/bounding_boxes
queue_size: 1
latch: false

detection_image:
topic: /darknet_ros/detection_image
queue_size: 1
latch: true

image_view:

enable_opencv: true
wait_key_delay: 1
enable_console_output: true
10 changes: 10 additions & 0 deletions config/global_costmap_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
global_costmap:
update_frequency: 0.5
publish_frequency: 0.5
transform_tolerance: 0.5
width: 50
height: 25
static_map: false
rolling_window: true
inflation_radius: 2.5
resolution: 0.01
12 changes: 12 additions & 0 deletions config/local_costmap_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local_costmap:
update_frequency: 5
publish_frequency: 5
transform_tolerance: 0.25
static_map: true
rolling_window: true
width: 3
height: 3
origin_x: -1.5
origin_y: -1.5
resolution: 0.01
inflation_radius: 1.0
17 changes: 17 additions & 0 deletions config/trajectory_planner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
TrajectoryPlannerROS:
max_vel_x: 0.1
min_vel_x: 0.01
max_vel_theta: 2.5
min_vel_theta: -2.5
min_in_place_vel_theta: 0.25

acc_lim_theta: 5.0
acc_lim_x: 1.5
acc_lim_Y: 1.5

holonomic_robot: false

meter_scoring: true

xy_goal_tolerance: 0.1
yaw_goal_tolerance: 0.05
13 changes: 13 additions & 0 deletions launch/amcl_only.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<launch>
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<remap from="scan" to="/scan"/>
<param name="odom_frame_id" value="odom"/>
<param name="odom_model_type" value="diff-corrected"/>
<param name="base_frame_id" value="base_link"/>
<param name="update_min_d" value="0.1"/>
<param name="update_min_a" value="1.0"/>
<param name="global_frame_id" value="map" />
<param name="use_map_topic" value="true" />
</node>

</launch>
27 changes: 27 additions & 0 deletions launch/amcl_only_rosbot1.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<launch>

<arg name="initial_pose_x" value="0.0"/>
<arg name="initial_pose_y" value="1.0"/>
<arg name="initial_pose_z" value="0.0"/>
<arg name="robot_name" value="rosbot1"/>

<node pkg="amcl" type="amcl" name="amcl1" output="screen">

<remap from="scan" to="$(arg robot_name)/scan"/>
<param name="odom_frame_id" value="$(arg robot_name)/odom"/>
<param name="odom_model_type" value="diff-corrected"/>
<param name="base_frame_id" value="$(arg robot_name)/base_link"/>
<param name="update_min_d" value="0.1"/>
<param name="update_min_a" value="1.0"/>
<param name="global_frame_id" value="map" />
<param name="use_map_topic" value="true" />

<param name="initial_pose_x" value="$(arg initial_pose_x)"/>
<param name="initial_pose_y" value="$(arg initial_pose_y)"/>
<param name="initial_pose_z" value="$(arg initial_pose_z)"/>
<remap from="initialpose" to="$(arg robot_name)/initialpose"/>
<remap from="amcl_pose" to="$(arg robot_name)/amcl_pose"/>
<remap from="particlecloud" to="$(arg robot_name)/particlecloud"/>
</node>

</launch>
28 changes: 28 additions & 0 deletions launch/amcl_only_rosbot2.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<launch>


<arg name="initial_pose_x" value="0.0"/>
<arg name="initial_pose_y" value="-1.0"/>
<arg name="initial_pose_z" value="0.0"/>
<arg name="robot_name" value="rosbot2"/>

<node pkg="amcl" type="amcl" name="amcl2" output="screen">

<remap from="scan" to="$(arg robot_name)/scan"/>
<param name="odom_frame_id" value="$(arg robot_name)/odom"/>
<param name="odom_model_type" value="diff-corrected"/>
<param name="base_frame_id" value="$(arg robot_name)/base_link"/>
<param name="update_min_d" value="0.1"/>
<param name="update_min_a" value="1.0"/>
<param name="global_frame_id" value="map" />
<param name="use_map_topic" value="true" />

<param name="initial_pose_x" value="$(arg initial_pose_x)"/>
<param name="initial_pose_y" value="$(arg initial_pose_y)"/>
<param name="initial_pose_z" value="$(arg initial_pose_z)"/>
<remap from="initialpose" to="$(arg robot_name)/initialpose"/>
<remap from="amcl_pose" to="$(arg robot_name)/amcl_pose"/>
<remap from="particlecloud" to="$(arg robot_name)/particlecloud"/>
</node>

</launch>
45 changes: 45 additions & 0 deletions launch/gmapping_only.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<launch>

<node pkg="gmapping" type="slam_gmapping" name="slam_gmapping" output="screen">
<remap from="/base_scan" to="/scan"/>

<param name="base_frame" value="base_link"/>
<param name="map_frame" value="map"/>
<param name="odom_frame" value="odom"/>

<param name="xmin" value="-5.0"/>
<param name="ymin" value="-5.0"/>
<param name="xmax" value="5.0"/>
<param name="ymax" value="5.0"/>
<param name="map_update_interval" value="5.0"/>
<param name="maxUrange" value="16.0"/>
<param name="sigma" value="0.05"/>
<param name="kernelSize" value="1"/>
<param name="lstep" value="0.05"/>
<param name="astep" value="0.05"/>
<param name="iterations" value="5"/>
<param name="lsigma" value="0.075"/>
<param name="ogain" value="3.0"/>
<param name="lskip" value="0"/>
<param name="srr" value="0.1"/>
<param name="srt" value="0.2"/>
<param name="str" value="0.1"/>
<param name="stt" value="0.2"/>
<param name="linearUpdate" value="0.05"/>
<param name="angularUpdate" value="0.05"/>
<param name="temporalUpdate" value="0.5"/>
<param name="resampleThreshold" value="0.5"/>
<param name="particles" value="30"/>
<param name="xmin" value="-2.0"/>
<param name="ymin" value="-10.0"/>
<param name="xmax" value="20.0"/>
<param name="ymax" value="10.0"/>
<param name="delta" value="0.05"/>
<param name="llsamplerange" value="0.01"/>
<param name="llsamplestep" value="0.01"/>
<param name="lasamplerange" value="0.005"/>
<param name="lasamplestep" value="0.005"/>
</node>

</launch>

12 changes: 12 additions & 0 deletions launch/move_base_only.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<launch>

<node pkg="move_base" type="move_base" name="move_base" output="log">
<param name="controller_frequency" value="10.0"/>
<rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find tutorial_pkg)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find multiple_rosbots_simulation)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find tutorial_pkg)/config/trajectory_planner.yaml" command="load" />
</node>

</launch>
79 changes: 79 additions & 0 deletions launch/move_base_rosbot1.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!--
ROS navigation stack with velocity smoother and safety (reactive) controller
-->
<launch>


<arg name="odom_frame_id" default="/rosbot1/odom"/>
<arg name="base_frame_id" default="/rosbot1/base_link"/>
<arg name="global_frame_id" default="/map"/>
<arg name="odom_topic" default="/rosbot1/odom" />
<arg name="laser_topic" default="/rosbot1/scan" />

<node pkg="move_base" type="move_base" respawn="false" name="move_base_rosbot1" output="screen">
<rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find tutorial_pkg)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find multiple_rosbots_simulation)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find tutorial_pkg)/config/trajectory_planner.yaml" command="load" />
<!-- external params file that could be loaded into the move_base namespace -->

<!-- reset frame_id parameters using user input data -->
<param name="global_costmap/global_frame" value="$(arg global_frame_id)"/>
<param name="global_costmap/robot_base_frame" value="$(arg base_frame_id)"/>
<param name="local_costmap/global_frame" value="$(arg odom_frame_id)"/>
<param name="local_costmap/robot_base_frame" value="$(arg base_frame_id)"/>
<param name="DWAPlannerROS/global_frame_id" value="$(arg odom_frame_id)"/>

<remap from="cmd_vel" to="/rosbot1/cmd_vel"/>
<remap from="odom" to="$(arg odom_topic)"/>
<remap from="scan" to="$(arg laser_topic)"/>
<remap from="map" to="/map" />
<remap from="/move_base_simple/goal" to="/rosbot1/move_base_simple/goal" />
<remap from="/move_base/TebLocalPlannerROS/global_plan" to="/rosbot1/move_base/TebLocalPlannerROS/global_plan" />
<remap from="/move_base/TebLocalPlannerROS/local_plan" to="/rosbot1/move_base/TebLocalPlannerROS/local_plan" />
<remap from="/move_base/TebLocalPlannerROS/teb_markers" to="/rosbot1/move_base/TebLocalPlannerROS/teb_markers" />
<remap from="/move_base/TebLocalPlannerROS/teb_markers_array" to="/rosbot1/move_base/TebLocalPlannerROS/teb_markers_array" />
<remap from="/move_base/TebLocalPlannerROS/teb_poses" to="/rosbot1/move_base/TebLocalPlannerROS/teb_poses" />
<remap from="/move_base/global_costmap/costmap" to="/rosbot1/move_base/global_costmap/costmap" />
<remap from="/move_base/global_costmap/costmap_updates" to="/rosbot1/move_base/global_costmap/costmap_updates" />
<remap from="/move_base/local_costmap/costmap" to="/rosbot1/move_base/local_costmap/costmap" />
<remap from="/move_base/local_costmap/costmap_updates" to="/rosbot1/move_base/local_costmap/costmap_updates" />
<remap from="/move_base/local_costmap/footprint" to="/rosbot1/move_base/local_costmap/footprint" />

<remap from="/move_base/GlobalPlanner/parameter_descriptions" to="/rosbot1/move_base/GlobalPlanner/parameter_descriptions" />
<remap from="/move_base/GlobalPlanner/parameter_updates" to="/rosbot1/move_base/GlobalPlanner/parameter_updates" />
<remap from="/move_base/GlobalPlanner/plan" to="/rosbot1/move_base/GlobalPlanner/plan" />
<remap from="/move_base/GlobalPlanner/potential" to="/rosbot1/move_base/GlobalPlanner/potential" />
<remap from="/move_base/TebLocalPlannerROS/obstacles" to="/rosbot1/move_base/TebLocalPlannerROS/obstacles" />
<remap from="/move_base/TebLocalPlannerROS/parameter_descriptions" to="/rosbot1/move_base/TebLocalPlannerROS/parameter_descriptions" />
<remap from="/move_base/TebLocalPlannerROS/parameter_updates" to="/rosbot1/move_base/TebLocalPlannerROS/parameter_updates" />
<remap from="/move_base/cancel" to="/rosbot1/move_base/cancel" />
<remap from="/move_base/current_goal" to="/rosbot1/move_base/current_goal" />
<remap from="/move_base/feedback" to="/rosbot1/move_base/feedback" />
<remap from="/move_base/global_costmap/footprint" to="/rosbot1/move_base/global_costmap/footprint" />
<remap from="/move_base/global_costmap/inflation_layer/parameter_descriptions" to="/rosbot1/move_base/global_costmap/inflation_layer/parameter_descriptions" />
<remap from="/move_base/global_costmap/inflation_layer/parameter_updates" to="/rosbot1/move_base/global_costmap/inflation_layer/parameter_updates" />
<remap from="/move_base/global_costmap/obstacle_layer/clearing_endpoints" to="/rosbot1/move_base/global_costmap/obstacle_layer/clearing_endpoints" />
<remap from="/move_base/global_costmap/obstacle_layer/parameter_descriptions" to="/rosbot1/move_base/global_costmap/obstacle_layer/parameter_descriptions" />
<remap from="/move_base/global_costmap/obstacle_layer/parameter_updates" to="/rosbot1/move_base/global_costmap/obstacle_layer/parameter_updates" />
<remap from="/move_base/global_costmap/parameter_descriptions" to="/rosbot1/move_base/global_costmap/parameter_descriptions" />
<remap from="/move_base/global_costmap/parameter_updates" to="/rosbot1/move_base/global_costmap/parameter_updates" />
<remap from="/move_base/global_costmap/static_layer/parameter_descriptions" to="/rosbot1/move_base/global_costmap/static_layer/parameter_descriptions" />
<remap from="/move_base/global_costmap/static_layer/parameter_updates" to="/rosbot1/move_base/global_costmap/static_layer/parameter_updates" />
<remap from="/move_base/goal" to="/rosbot1/move_base/goal" />
<remap from="/move_base/local_costmap/obstacle_layer/parameter_descriptions" to="/rosbot1/move_base/local_costmap/obstacle_layer/parameter_descriptions" />
<remap from="/move_base/local_costmap/obstacle_layer/parameter_updates" to="/rosbot1/move_base/local_costmap/obstacle_layer/parameter_updates" />
<remap from="/move_base/local_costmap/parameter_descriptions" to="/rosbot1/move_base/local_costmap/parameter_descriptions" />
<remap from="/move_base/local_costmap/parameter_updates" to="/rosbot1/move_base/local_costmap/parameter_updates" />
<remap from="/move_base/local_costmap/static_layer/parameter_descriptions" to="/rosbot1/move_base/local_costmap/static_layer/parameter_descriptions" />
<remap from="/move_base/local_costmap/static_layer/parameter_updates" to="/rosbot1/move_base/local_costmap/static_layer/parameter_updates" />
<remap from="/move_base/parameter_descriptions" to="/rosbot1/move_base/parameter_descriptions" />
<remap from="/move_base/parameter_updates" to="/rosbot1/move_base/parameter_updates" />
<remap from="/move_base/result" to="/rosbot1/move_base/result" />
<remap from="/move_base/status" to="/rosbot1/move_base/status" />
<remap from="/move_base_simple/goal" to="/rosbot1/move_base_simple/goal" />
</node>


</launch>
Loading

0 comments on commit 438d00a

Please sign in to comment.