Skip to content

Commit

Permalink
Merge pull request #11 from OneNightROBOCON/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
dashimaki360 authored Jul 29, 2019
2 parents 04b0506 + 6a14253 commit ef5ed5a
Show file tree
Hide file tree
Showing 35 changed files with 1,962 additions and 72 deletions.
61 changes: 46 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# burger_war
ロボットで戦車対戦をするゲームです。
大砲で撃つ代わりに、カメラでターゲットのARマーカーを読み取ります。
大砲で撃つ代わりに、カメラでターゲットのARマーカーを読み取ります。<BR>

## 目次
- インストール
Expand Down Expand Up @@ -45,6 +45,11 @@ source ~/.bashrc
```

### 2. このリポジトリをクローン
gitをインストールします。
```
sudo apt-get install git
```

turtlr_war リポジトリをクローンします。
先程作ったワークスペースの`src/`の下においてください。
```
Expand Down Expand Up @@ -87,7 +92,17 @@ catkin_make

## サンプルの実行
### シミュレータ
シミュレータ、ロボット(turtle_bot),審判サーバー、観戦画面のすべてを一発で起動する。大会で使用するスクリプト。
シミュレータ、ロボット(turtle_bot),審判サーバー、観戦画面のすべてを一発で起動する。大会で使用するスクリプト。<BR>
最初にburger_warのフォルダまで移動します。
```
cd ~/catkin_ws/src/burger_war
```
初回のみ、以下のコマンドでGazeboを起動し、モデルデータ等を読み込んでおくとよいです。<BR>
(初回はGazeboの起動がおそいので)
```
gazebo
```
次にシミュレーションを起動
```
bash scripts/sim_with_judge.sh
```
Expand Down Expand Up @@ -133,34 +148,34 @@ roslaunch burger_war action.launch
## ファイル構成
各ディレクトリの役割と、特に参加者に重要なファイルについての説明

下記のようなディレクトリ構成になっています。  
下記のようなディレクトリ構成になっています。

```
burger_war
├── burger_war
   ├── CMakeLists.txt
   ├── launch launchファイルの置き場
├── CMakeLists.txt
├── launch launchファイルの置き場
│ │ ├── sim_robot_run.launch シミュレータ上で2台のロボットを動かすlaunchファイル
│ │ └─ setup_sim.launch Gazeboシミュレータ上でフィールドの生成ロボットを起動、初期化するlaunchファイル
│ │
   ├── models   GAZEBOシミュレーター用のモデルファイル
   ├── package.xml
   ├── scripts    pythonで書かれたROSノード
   └── world     GAZEBO用の環境ファイル
       ├── gen.sh         burger_field.world.emから burger_field.worldを作成するスクリプト
       ├── burger_field.world  最新のworldファイル
       └── burger_field.world.em  worldファイルのマクロ表記版、こっちを編集する
├── models GAZEBOシミュレーター用のモデルファイル
├── package.xml
├── scripts pythonで書かれたROSノード
└── world GAZEBO用の環境ファイル
├── gen.sh burger_field.world.emから burger_field.worldを作成するスクリプト
├── burger_field.world 最新のworldファイル
└── burger_field.world.em worldファイルのマクロ表記版、こっちを編集する
|
├── judge   審判サーバー
├── judge 審判サーバー
│ ├── judgeServer.py 審判サーバー本体
│ ├── log ログがここにたまる
│ ├── marker_set マーカーの配置設定ファイル置き場
│ ├── picture 観戦画面用画像素材
│ ├── README.md
   ├── test_scripts   初期化などのスクリプト
├── test_scripts 初期化などのスクリプト
│ └── visualizeWindow.py 観戦画面表示プログラム
|
├── README.md   これ
├── README.md これ
├── rulebook.md ルールブック
└── scripts 一発起動スクリプト
├─── sim_with_judge.sh シミュレーターとロボットと審判サーバーの立ち上げ初期化をすべて行う
Expand All @@ -172,3 +187,19 @@ burger_war
- Ubuntu 16.04
- Ros kinetic
2018年からkineticで開発しています。

## Turtlebot3のスペック
- http://emanual.robotis.com/docs/en/platform/turtlebot3/specifications/

## その他
https://github.com/gogo5nta さんに一括でインストールするスクリプトを作成いただいたので本リポジトリにも置いています。
ご活用ください。
```
// ROS(kinetic)を一括インストール
$ chdmod 777 ./scripts/install_ros_kinetic.sh
$ ./scripts/install_ros_kinetic.sh
// Robocon2019に必要な物を一括インストール
$ chdmod 777 ./scripts/add_robocon2019.sh
$ ./scripts/add_robocon2019.sh
```
199 changes: 199 additions & 0 deletions burger_navigation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
cmake_minimum_required(VERSION 2.8.3)
project(burger_navigation)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
)

## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )

## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )

## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )

###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES burger_war
# CATKIN_DEPENDS roscpp rospy std_msgs
# DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
${catkin_INCLUDE_DIRS}
)

## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/burger_war.cpp
# )

## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/burger_war_node.cpp)

## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
# target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES}
# )

#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
# FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
# )

## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )

#############
## Testing ##
#############

## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_burger_war.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()

## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
92 changes: 92 additions & 0 deletions burger_navigation/launch/burger_navigation.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0"?>

<launch>
<!-- Arguments -->
<arg name="map_file" default="$(find burger_navigation)/maps/map.yaml"/>
<arg name="open_rviz" default="true"/>
<arg name="move_forward_only" default="false"/>
<arg name="cmd_vel_topic" default="cmd_vel" />
<arg name="odom_topic" default="odom" />
<arg name="scan_topic" default="scan"/>
<arg name="initial_pose_x" default="-1.3"/>
<arg name="initial_pose_y" default="0.0"/>
<arg name="initial_pose_a" default="0.0"/>
<arg name="robot_name" default="" />

<!-- Turtlebot3 -->
<include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
<arg name="model" value="burger" />
<arg name="multi_robot_name" value="$(arg robot_name)" />
</include>

<!-- Map server -->
<node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)">
<param name="frame_id" value="$(arg robot_name)/map"/>
</node>


<!-- AMCL -->
<node pkg="amcl" type="amcl" name="amcl">
<param name="min_particles" value="500"/>
<param name="max_particles" value="3000"/>
<param name="kld_err" value="0.02"/>
<param name="update_min_d" value="0.20"/>
<param name="update_min_a" value="0.20"/>
<param name="resample_interval" value="1"/>
<param name="transform_tolerance" value="0.5"/>
<param name="recovery_alpha_slow" value="0.00"/>
<param name="recovery_alpha_fast" value="0.00"/>
<param name="initial_pose_x" value="$(arg initial_pose_x)"/>
<param name="initial_pose_y" value="$(arg initial_pose_y)"/>
<param name="initial_pose_a" value="$(arg initial_pose_a)"/>
<param name="gui_publish_rate" value="50.0"/>

<remap from="scan" to="$(arg scan_topic)"/>
<param name="laser_max_range" value="3.5"/>
<param name="laser_max_beams" value="180"/>
<param name="laser_z_hit" value="0.5"/>
<param name="laser_z_short" value="0.05"/>
<param name="laser_z_max" value="0.05"/>
<param name="laser_z_rand" value="0.5"/>
<param name="laser_sigma_hit" value="0.2"/>
<param name="laser_lambda_short" value="0.1"/>
<param name="laser_likelihood_max_dist" value="2.0"/>
<param name="laser_model_type" value="likelihood_field"/>

<param name="odom_model_type" value="diff"/>
<param name="odom_alpha1" value="0.1"/>
<param name="odom_alpha2" value="0.1"/>
<param name="odom_alpha3" value="0.1"/>
<param name="odom_alpha4" value="0.1"/>
<param name="odom_frame_id" value="$(arg robot_name)/odom"/>
<param name="base_frame_id" value="$(arg robot_name)/base_footprint"/>
<param name="global_frame_id" value="$(arg robot_name)/map"/>
</node>


<!-- move_base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
<rosparam file="$(find burger_navigation)/param/costmap_common_params_burger.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find burger_navigation)/param/costmap_common_params_burger.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find burger_navigation)/param/local_costmap_params.yaml" command="load" />
<rosparam file="$(find burger_navigation)/param/global_costmap_params.yaml" command="load" />
<rosparam file="$(find burger_navigation)/param/move_base_params.yaml" command="load" />
<rosparam file="$(find burger_navigation)/param/dwa_local_planner_params_burger.yaml" command="load" />
<remap from="cmd_vel" to="$(arg cmd_vel_topic)"/>
<remap from="odom" to="$(arg odom_topic)"/>
<param name="DWAPlannerROS/min_vel_x" value="0.0" if="$(arg move_forward_only)" />

<param name="local_costmap/global_frame" value="$(arg robot_name)/odom"/>
<param name="local_costmap/robot_base_frame" value="$(arg robot_name)/base_link"/>
<param name="global_costmap/robot_base_frame" value="$(arg robot_name)/base_link"/>
<param name="global_costmap/global_frame" value="$(arg robot_name)/map"/>
</node>

<!-- rviz -->
<group if="$(arg open_rviz)">
<node pkg="rviz" type="rviz" name="rviz" required="true" args="-d $(find burger_navigation)/rviz/$(arg robot_name)_navigation.rviz">
<remap from="/move_base_simple/goal" to="move_base_simple/goal"/>
</node>
</group>
</launch>
Loading

0 comments on commit ef5ed5a

Please sign in to comment.