## For instruction on writing tutorials
## http://www.ros.org/wiki/WritingTutorials
####################################
##FILL ME IN
####################################
## for a custom note with links:
## note =
## for the canned note of "This tutorial assumes that you have completed the previous tutorials:" just add the links 
## note.0= 
## descriptive title for the tutorial
## title = 安装与使用
## multi-line description to be displayed in search 
## description = 在ROS kinetic 环境下使用Caster
## the next tutorial description (optional)
## next =
## links to next tutorial (optional)
## next.0.link=
## next.1.link=
## what level user is this tutorial for 
## level= IntermediateCategory
## keywords = 智科特机器人 Caster
####################################

<<IncludeCSTemplate(TutorialCSHeaderTemplate)>>

<<TableOfContents(4)>>

本教程主要包含安装与使用方法,熟悉以下操作可以让你初步使用Caster,这在将来的开发中会是很有帮助的。

== 安装 ==
1. 拷贝github存储库
{{{
cd ~/catkin_ws/src
curl https://raw.githubusercontent.com/I-Quotient-Robotics/caster_ros/master/caster_desktop_install.sh | sh
}}}
2. 编译
{{{
cd .. || catkin_make
}}}

== 前期准备 ==
=== 网络信息 ===
==== 基础信息 ====
||网关||192.168.33.0/24||
==== 设备列表 ====
||设备||主机名||IP地址||
||Caster-PC||caster-pc||192.168.33.5||
||Hokuyo LX-20||无||192.168.33.7||
==== 外部设备设置 ====
||地址||192.168.33.x||
||子网掩码||255.255.255.0||
=== 网络连接 ===
现需一台装有ROS Kinetic的Ubuntu电脑,下文简称外部PC,将网线连接到底盘的交换机上,并参考上文的网路信息配置,设置外部PC的IP地址,使用PING指令,测试和Caster-PC的网络通信情况。
==== 测试网络 ====
1. 使用IP地址测试 
{{{
ping 192.168.33.5
}}}
2. 使用域名测试
{{{
ping caster-pc.local
}}}
==== 设置外部设备 ====
{{{
echo 'export ROS_MASTER_URI="http://caster-pc.local:11311"' >> ~/.bashrc
}}}
按照以上操作完成通信连接,然后重启终端。

== ROS功能启动 ==
1. 使用SSH登录到Caster的PC中,IP地址参考网络信息。

2. 运行如下代码,启动底盘控制程序。
{{{
roslaunch caster_base base.launch
}}}
3. 底盘启动后,可以在外部PC中,运行如下指令,启动ROS诊断信息监控程序。
{{{
rosrun rqt_runtime_monitor rqt_runtime_monitor
}}}
4. 也可以在外部PC中,使用Rviz来查看Caster传感器的信息。
{{{
roslaunch caster_viz display.launch type:=view
}}}
== 手柄控制 ==
=== 手柄功能定义 ===
查看github wiki [[https://github.com/I-Quotient-Robotics/caster_ros/wiki/ | Definition]]
=== 移动操作 ===
1. 启动ROS功能并将手柄连接到外部设备。

2.在外部PC中,运行如下指令,启动Caster的遥控程序。
{{{
roslaunch caster_teleop teleop.launch
}}}
3. 根据手柄功能定义,操控Caster进行移动。

== 地图创建 ==
1. 在Caster-PC上执行以下命令启动建图程序。
{{{
roslaunch caster_navigation gmapping.launch
}}}
2. 在外部PC上,启动rviz查看建图过程。
{{{
roslaunch caster_viz display.launch type:=gmapping
}}}
3. 启动手柄控制,移动Caster完成建图,在Caster-PC上执行一下命令,保存地图到期望位置。
{{{
roscd caster_navigation/map || rosrun map_server map_saver -f [map name]
}}}
== 定位导航 ==
1. 在Caster-PC上执行以下命令,启动定位导航功能,并使用map_file参数指定要加载的地图,例如加载home地图。
{{{
roslaunch caster_navigation navigation.launch map_file:=$(rospack find caster_base)/map/home.yaml
}}}
2. 在外部PC启动rviz。
{{{
roslaunch caster_viz display.launch type:= navigation
}}}

3.在Rviz中,设定机器人的初始坐标,并可以选定导航目标。

== 自动充电 ==
1. 参考定位导航,启动Caster的定位导航功能,并正确设置Caster在地图中的位置,参考自动充电功能原理和配置,完成对充电桩位置的设定。

2. 在Caster-PC上执行如下命令,启动自动充电功能。
{{{
roslaunch caster_app caster_app.launch
}}}
3. 按下手柄的START按键,Caster开始执行自动充电程序,充电完成后,按下手柄的BACK按键,Caster从充电桩中推出。

注意:在Caster位于充电桩内时,勿使用导航功能,以免损坏Caster的受电模块。要使用导航功能,请确保Caster正确从充电桩中推出。
## AUTOGENERATED DO NOT DELETE 
## TutorialCategory
## FILL IN THE STACK TUTORIAL CATEGORY HERE
----