# 6.2 Тестирование симулятора

Чтобы убедиться, что все работает, убедитесь, что roscore работает, затем запустите смоделированный TurtleBot следующим образом:

```
$ roslaunch rbx1_bringup fake_turtlebot.launch
```

что должно привести к следующим сообщениям при запуске:

> process\[arbotix-1]: started with pid \[4896]

> process\[robot\_state\_publisher-2]: started with pid \[4897]
>
> \[INFO] \[WallTime: 1338681385.068539] ArbotiX being simulated.&#x20;
>
> \[INFO] \[WallTime: 1338681385.111492] Started DiffController
>
> &#x20;(base\_controller). Geometry: 0.26m wide, 4100.0 ticks/m.

Чтобы вместо этого использовать модель Pi Robot, выполните команду:

```
$ roslaunch rbx1_bringup fake_pi_robot.launch
```

Далее, запустите RViz, чтобы мы могли наблюдать за симулированным роботом в действии:

```
$ rosrun rviz rviz -d `rospack find rbx1_nav`/sim.rviz
```

(Обратите внимание, как мы используем оператор backtick в Linux вместе с командой rospack find, чтобы найти пакет rbx1\_nav без необходимости вводить полный путь.)&#x20;

Если все прошло правильно, вы должны увидеть TurtleBot (или Pi Robot) в RViz. (Вид по умолчанию сверху вниз. Чтобы изменить вид, нажмите на меню «Панели» в RViz и выберите пункт меню «Виды».)&#x20;

Чтобы проверить симуляцию, откройте другое окно терминала или вкладку и выполните следующую команду, которая должна заставить симулированного робота двигаться по кругу против часовой стрелки:

```
$ rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear: {x: 0.2, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0.5}}'
```

Вид в RViz должен выглядеть примерно так. (Изображение ниже было увеличено с помощью колеса прокрутки мыши.)

![](https://2819635344-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8WNs5mrrnGnm_5SpiI%2F-M8XNcaHFhxJMsjm9SoO%2F-M8XUBqS50s5dtVPR9u6%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202020-05-30%20%D0%B2%2001.10.43.png?alt=media\&token=136f04ce-1c3a-430b-99e1-16f0223cc449)

Чтобы остановить вращение, введите Ctrl-C в том же окне терминала, а затем опубликуйте пустое сообщение Twist:

```
$ rostopic pub -1 /cmd_vel geometry_msgs/Twist '{}'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ritka.gitbook.io/translate-book/6.2-testirovanie-simulyatora.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
