sudo apt install ros-noetic-gmapping
sudo apt install ros-noetic-map-server
sudo apt install ros-noetic-navigation
This repo is recommended pushing From WSL Ubuntu20.04.
And Rasbpi 4B pulls this repo.
- if want test level 1 ~ level 5:
git chechout feature/wheel-and-camera-integrate
- if only want test level 6(tunnel navigation),
git chechout Fix/navigation-and-main-program-connection
- use terminal to open gazebo simulation environment
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_world.launch
- modify begin_state & reset_state in
auto.launch
- if you want to test level 2(turn sign), set
begin_state = 2
&reset_state = 2
- if you want to test level 2 to level 4, set
begin_state = 2
&reset_state = 4
- etc.
- if you want to test level 2(turn sign), set
- open new terminal and launch navigation programs
source devel/setup.bash
roslaunch race auto.launch
- NOTE: because I'm testing in virtual machine that can't open camera of computer So, all program about openCV are changed to photo reading mode If you don't set the source photo path correct. openCV won't process any photo, and the program won't stop!!!
// can only set direct path like below, relative path is NOT allowed! (IDK why, maybe a bug)
#define SOURCE_TURN_LEFT "/home/twang/pictureSource/turntest.jpg"
// and function will read the photo directly
img = imread(SOURCE_TURN_LEFT);
you can add an integer variable to limit the running times of while loops to prevent infinite loop like below
int testCounter = 0;
do {
testCounter ++;
WHEEL::move_front(3, 0);
VISION::takingPhoto(3);
} while (!VISION::isDetected && testCounter < 20);
- use terminal to open gazebo simulation environment
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_world.launch
- set the navigation goal in
move_base.launch
<param name="/goal_x" type="double" value="0.0" />
<param name="/goal_y" type="double" value="0.5" />
- note that thay're global position in gazebo world, not local position!!!
- open new terminal and launch navigation programs
source devel/setup.bash
roslaunch tb3_navigation move_base.launch
- check out this repo.
- The original version of the openCV programs used in this project are there.
- 進行更動前請先
git pull
確認目前位於最新的主分支上,若已經改動程式碼才發現忘記開新分支,可以善用git stash
- 請確認修改完的程式要可以正確執行
catkin_make
編譯完成沒有錯誤或警告後再 Commit - 請勿將程式碼直接推到主分支
master
,任何更改請一律開新分支再發送 PR - 分支名稱可以按照功能以及內容命名,例如
feature/background_music
、fix/change_background_music
feature
: 新增新的內容fix
: 修改既有的內容
- 版本落後主分支太多的分支請不要繼續使用,請以最新版的主分支為基準再開一個新分支
- Commit Message 編寫方式以及 branch 命名方式可以參考這個連結。不強制要求,但是寫清楚可以方便其他人了解更改內容與 debug
不強制,但提供一些規範給大家參考
- 建議開啟 VScode 自動排版功能
- 進入 Setting
- 搜尋 Format
- 將 Format On Save 選項打勾
- fileName 與 class 使用 Pascal Case
Wheel.cpp
class Cameras{}
- public variable 與 function name 使用 Pascal Case
public int MaxHealthPoint;
void ResetHealthPoint(){}
- variable 與 function parameters 使用 Camel Case
void SetHealthPoint(int healthPoint){}
private int currentHealthPoint;
- 避免使用簡稱
int spd
=>int speed
GameObject tgt
=>GameObject target
- 布林變數或回傳 bool 的 function 以
is
或has
作為開頭private bool _isDied;
private bool HasBuff(){}