반응형
혹시나 까먹을까 하고 다시 한번 New Robot Controller를 불러옵니다.
Wizards -> New Robot Controller -> and then you can make your own Robot controller : )
참고하면 도움되는 Reference Manual
node and API functions : https://cyberbotics.com/doc/reference/nodes-and-api-functions?tab-language=python
순서는 다음과 같다.
1. Controller API로 부터 Robot, DistanceSensor, Motor를 호출하고
2. time step을 정해준다.
3. 그리고 각 step 마다 어떤 행동을 할 것인지에 대해 말해준다.
4. 각 step 별로 initialize 를 해줘야 하기 때문에,
- Devices 를 초기화 시키고, ( 여기서는 Distance sensor )
- 그 후에는 robot 의 모터를 초기화 시킨다.
- 그리고 센서에 대한 array를 만들어서 값을 저장시킬 준비를 하고,
- 센서가 장애물을 발견했을 때, 어떤 기준으로 판별할 것인지에 대해 설정한다.
5. 장애물이 발견되었을 때, 발견되지 않았을 때, 어떻게 행동하는지에 대한 예시를 적어준다.
반응형
'AI > python or ros_Webot' 카테고리의 다른 글
Webots Tutorial 6 - 4-Wheels Robot (0) | 2020.02.20 |
---|---|
Webots Tutorial 5 - Compound Solid and Physics Attributes (0) | 2020.02.19 |
Webots Tutorial 3 - Appearance (0) | 2020.02.19 |
Webots Tutorial 2 - Modification of the Environment (0) | 2020.02.18 |
Webots Tutorial 1 - Your First Simulation in Webots (0) | 2020.02.17 |
댓글