Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Update turtlebot3 doc. (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanyen authored Sep 21, 2020
1 parent c506695 commit ea941e4
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 50 deletions.
119 changes: 69 additions & 50 deletions docs/Turtlebot/Turtlebot3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,19 @@ The TurtleBot3 uses a Lidar which requires the following driver.

* [CP2102 Driver](https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers)

## Guide
### General notes
## General notes
The TurtleBot3 documentation uses the unix command 'export' to set environment variables, instead use the following:
```bat
set TURTLEBOT3_MODEL=waffle
```
> NOTE: The value of %TURTLEBOT3_MODEL% is case-sensitive.
Please use turtlebot3_bringup-win.launch which has Windows device bindings.

## Setup
## Step 1: Setup
### PC Setup
Please follow the instructions for setting up your computer with [ROS on Windows](../GettingStarted/Setup.md).

### SBC Setup
You can bypass this section
You can bypass this section.

### OpenCR Setup
Please follow the Windows instructions for the [ROBOTIS OpenCR board in the ROBOTIS Manual](http://emanual.robotis.com/docs/en/parts/controller/opencr10/).
Expand All @@ -35,23 +32,18 @@ ROS on Windows requires a x64 bit Windows 10 Desktop or Windows 10 IoT Enterpris

> ROS on Windows was brought up using [UP2](https://up-board.org/upsquared/specifications/) and an Intel NUC.
## Create a new workspace
## Step 2: Create a new Workspace
In a Command Window set up with the ROS environment, create a directory for your robot workspaces and a workspace for TurtleBot3.

```bat
mkdir c:\ws\turtlebot3\src
cd c:\ws\turtlebot3\src
catkin_init_workspace
git clone -b melodic-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs
git clone -b melodic-devel https://github.com/ms-iot/turtlebot3_simulations
git clone -b melodic-devel https://github.com/ms-iot/turtlebot3.git
git clone -b melodic-devel https://github.com/ms-iot/hls_lfcd_lds_driver
cd c:\ws\turtlebot3
rosdep update
rosdep install --from-paths src --ignore-src -r -y
curl -o tb3.repos https://raw.githubusercontent.com/ms-iot/ROSOnWindows/master/docs/Turtlebot/turtlebot3_ros1.repos
vcs import src < tb3.repos
```

## Customize TurtleBot3 Launch Files
## Step 3: Customize TurtleBot3 Launch Files
Modify the ROS Launch files to map the devices to the correct COM port. To determine which COM ports you require, right click on the Windows Start Menu, Select Device Manager.

Under the `Ports (COM & LPT)` node:
Expand All @@ -61,29 +53,24 @@ Under the `Ports (COM & LPT)` node:

Enter the COM port in the correct fields in the launch files below:

*turtlebot3_bringup/launch/turtlebot3_core-win.launch*
*turtlebot3_bringup/launch/turtlebot3_core.launch*

```xml
<node pkg="rosserial_python" type="serial_node.py" name="turtlebot3_core" output="screen">
<param name="port" value="COMx"/>
```

*turtlebot3_bringup/launch/turtlebot3_lidar-win.launch*
*turtlebot3_bringup/launch/turtlebot3_lidar.launch*

```xml
<node pkg="hls_lfcd_lds_driver" type="hlds_laser_publisher" name="turtlebot3_lds" output="screen">
<param name="port" value="COMy"/>
```


## Build Nodes
## Step 4: Build the Workspace
To build the TurtleBot3 packages, enter the TurtleBot3 workspace and build using the catkin build system.

```bat
:: make sure all required binaries installed.
choco upgrade ros-melodic-desktop_full -y
```

```bat
:: build TurtleBot3 workspace.
cd c:\ws\turtlebot3
Expand All @@ -99,28 +86,50 @@ c:\ws\turtlebot3\devel\setup.bat
> If you forget to merge the TurtleBot3 environment by calling the setup batch file, you'll get an error such as this:
> `RLException: [turtlebot3_robot.launch] is neither a launch file in package [turtlebot3_bringup] nor is [turtlebot3_bringup] a launch file name`
## Running TurtleBot
## Step 5: Run TurtleBot3

### No Robot - No Problem!
rViz is tool which allows you to visualize a representation of a robot, and project fake data in order to exerise or develop logic. The TurtleBot3 simulation is in the `turtlebot3_simulations` package.

To start the simulation, open one elevated command prompt:

```bat
c:\opt\ros\melodic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_fake turtlebot3_fake.launch
```
=== "Noetic"

```bat
c:\opt\ros\noetic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_fake turtlebot3_fake.launch
```

=== "Melodic"

```bat
c:\opt\ros\melodic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_fake turtlebot3_fake.launch
```

Then, open another elevated command prompt:

```bat
c:\opt\ros\melodic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
```
=== "Noetic"

```bat
c:\opt\ros\noetic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
```

=== "Melodic"

```bat
c:\opt\ros\melodic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
```

Now you should see TurtleBot3 random walking on RViz. You can create your own logic which reads `/odom` or publish `/cmd_vel` to move the virtual robot.

Expand All @@ -129,19 +138,29 @@ SLAM (Simultaneous localization and mapping) is a very popular application in th

To start this demo, open an evelated command prompt:

```bat
:: make sure all required binaries installed.
choco upgrade ros-melodic-desktop_full -y
choco upgrade ros-melodic-cartographer_ros -y
```
=== "Noetic"

```bat
:: run the demo.
c:\opt\ros\melodic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle
roslaunch turtlebot3_gazebo turtlebot3_gazebo_cartographer_demo.launch
```
```bat
:: run the demo.
c:\opt\ros\noetic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle

curl -o turtlebot3_demo.launch https://raw.githubusercontent.com/ms-iot/ROSOnWindows/master/docs/Turtlebot/turtlebot3_demo.launch
roslaunch turtlebot3_demo.launch
```

=== "Melodic"

```bat
:: run the demo.
c:\opt\ros\melodic\x64\setup.bat
c:\ws\turtlebot3\devel\setup.bat
set TURTLEBOT3_MODEL=waffle

curl -o turtlebot3_demo.launch https://raw.githubusercontent.com/ms-iot/ROSOnWindows/master/docs/Turtlebot/turtlebot3_demo.launch
roslaunch turtlebot3_demo.launch
```

After a few moments, you will see Gazebo running a simulated world with your simulated TurtleBot3, RViz running the mapping progress, and a simulation node to drive the TurtleBot3 random walking.

Expand All @@ -156,5 +175,5 @@ In one command window, start `roscore`.
In another command window, launch the TurtleBot robot code.

```bat
roslaunch turtlebot3_bringup turtlebot3_robot-win.launch
roslaunch turtlebot3_bringup turtlebot3_robot.launch
```
12 changes: 12 additions & 0 deletions docs/Turtlebot/turtlebot3_demo.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<launch>
<env name="GAZEBO_PLUGIN_PATH" value="$(find gazebo_plugins)"/>
<env name="GAZEBO_MODEL_PATH" value="$(find turtlebot3_gazebo)/models"/>

<include file="$(find turtlebot3_gazebo)/launch/turtlebot3_world.launch"/>
<include file="$(find turtlebot3_slam)/launch/turtlebot3_slam.launch">
<arg name="slam_methods" value="cartographer" />
<arg name="configuration_basename" value="turtlebot3_lds_2d_gazebo.lua" />
</include>
<include file="$(find turtlebot3_gazebo)/launch/turtlebot3_simulation.launch" />

</launch>
17 changes: 17 additions & 0 deletions docs/Turtlebot/turtlebot3_ros1.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repositories:
turtlebot3/turtlebot3_msgs:
type: git
url: https://github.com/ROBOTIS-GIT/turtlebot3_msgs
version: master
turtlebot3/turtlebot3:
type: git
url: https://github.com/ROBOTIS-GIT/turtlebot3.git
version: master
turtlebot3/turtlebot3_simulations:
type: git
url: https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
version: master
utils/hls_lfcd_lds_driver:
type: git
url: https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git
version: master

0 comments on commit ea941e4

Please sign in to comment.