< >
Home » Turtlebot入门教程 » Turtlebot入门教程-安装Turtlebot(ubuntu18.04+Melodic)

Turtlebot入门教程-安装Turtlebot(ubuntu18.04+Melodic)

**Turtlebot入门教程-安装Turtlebot(ubuntu18.04+Melodic) **

说明:

  • 介绍如何在ubuntu 18.04系统下安装turtlebot

步骤:

  • 先完成ROS melodic安装,参考教程:https://www.ncnynl.com/archives/201903/2897.html

  • 安装依赖:

$ sudo apt-get install ros-melodic-kobuki-*
$ sudo apt-get install ros-melodic-ecl-streams
$ sudo apt-get install libusb-dev
$ sudo apt-get install libspnav-dev
$ sudo apt-get install ros-melodic-joystick-drivers
$ sudo apt-get install bluetooth
$ sudo apt-get install libbluetooth-dev
$ sudo apt-get install libcwiid-dev
$ sudo apt-get install ros-melodic-bfl 
  • 新建工作空间,准备相关包
$ mkdir -p ~/turtlebot_ws/src 
$ cd ~/turtlebot_ws/src 

$ git clone https://github.com/turtlebot/turtlebot_simulator
$ git clone https://github.com/turtlebot/turtlebot.git
$ git clone https://github.com/turtlebot/turtlebot_apps.git
$ git clone https://github.com/udacity/robot_pose_ekf
$ git clone https://github.com/ros-perception/depthimage_to_laserscan.git 
$ git clone https://github.com/yujinrobot/kobuki_msgs.git
$ git clone https://github.com/yujinrobot/kobuki_desktop.git
$ cd kobuki_desktop/
$ rm -r kobuki_qtestsuite
$ cd ~/turtlebot_ws/src 
$ git clone https://github.com/toeklk/orocos-bayesian-filtering.git
$ git clone https://github.com/turtlebot/turtlebot_msgs.git
$ git clone https://github.com/ros-drivers/joystick_drivers.git
  • 如果github.com不能正常访问,修改所有相关地址增加代理,如:
https://ghproxy.com/https://github.com/xxxxxxx
  • 复制kobuki和yujin_ocs依赖库到turtlebot_ws/src工作空间下
$ mkdir -p ~/repos/
$ cd ~/repos/
$ git clone https://github.com/yujinrobot/kobuki.git
$ cp -r kobuki/* ~/turtlebot_ws/src/
$ git clone https://github.com/yujinrobot/yujin_ocs.git
$ cp -r yujin_ocs/yocs_cmd_vel_mux/ yujin_ocs/yocs_controllers ~/turtlebot_ws/src/
  • 如果github.com不能正常访问,修改所有相关地址增加代理,如:
https://ghproxy.com/https://github.com/xxxxxxx
  • 编译工作空间
$ cd ~/turtlebot_ws
$ catkin_make
  • 添加工作空间到bashrc文件
echo "source ~/turtlebot_ws/devel/setup.bash" >> ~/.bashrc
  • 启用环境变量
source ~/.bashrc 

测试:

  • 启动底盘
roslaunch turtlebot_bringup minimal.launch
  • 显示如下:
ubuntu@AiROS-XA:~/turtlebot_ws/src$ roslaunch turtlebot_bringup minimal.launch 
... logging to /home/ubuntu/.ros/log/a22c211a-7888-11e9-8396-00044bcb943f/roslaunch-AiROS-XA-6402.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://AiROS-XA:41151/

SUMMARY
========

PARAMETERS
 * /bumper2pointcloud/pointcloud_radius: 0.24
 * /cmd_vel_mux/yaml_cfg_file: /home/ubuntu/turt...
 * /diagnostic_aggregator/analyzers/input_ports/contains: ['Digital Input',...
 * /diagnostic_aggregator/analyzers/input_ports/path: Input Ports
 * /diagnostic_aggregator/analyzers/input_ports/remove_prefix: mobile_base_nodel...
 * /diagnostic_aggregator/analyzers/input_ports/timeout: 5.0
 * /diagnostic_aggregator/analyzers/input_ports/type: diagnostic_aggreg...
 * /diagnostic_aggregator/analyzers/kobuki/contains: ['Watchdog', 'Mot...
 * /diagnostic_aggregator/analyzers/kobuki/path: Kobuki
 * /diagnostic_aggregator/analyzers/kobuki/remove_prefix: mobile_base_nodel...
 * /diagnostic_aggregator/analyzers/kobuki/timeout: 5.0
 * /diagnostic_aggregator/analyzers/kobuki/type: diagnostic_aggreg...
 * /diagnostic_aggregator/analyzers/power/contains: ['Battery', 'Lapt...
 * /diagnostic_aggregator/analyzers/power/path: Power System
 * /diagnostic_aggregator/analyzers/power/remove_prefix: mobile_base_nodel...
 * /diagnostic_aggregator/analyzers/power/timeout: 5.0
 * /diagnostic_aggregator/analyzers/power/type: diagnostic_aggreg...
 * /diagnostic_aggregator/analyzers/sensors/contains: ['Cliff Sensor', ...
 * /diagnostic_aggregator/analyzers/sensors/path: Sensors
 * /diagnostic_aggregator/analyzers/sensors/remove_prefix: mobile_base_nodel...
 * /diagnostic_aggregator/analyzers/sensors/timeout: 5.0
 * /diagnostic_aggregator/analyzers/sensors/type: diagnostic_aggreg...
 * /diagnostic_aggregator/base_path: 
 * /diagnostic_aggregator/pub_rate: 1.0
 * /mobile_base/base_frame: base_footprint
 * /mobile_base/battery_capacity: 16.5
 * /mobile_base/battery_dangerous: 13.2
 * /mobile_base/battery_low: 14.0
 * /mobile_base/cmd_vel_timeout: 0.6
 * /mobile_base/device_port: /dev/kobuki
 * /mobile_base/odom_frame: odom
 * /mobile_base/publish_tf: True
 * /mobile_base/use_imu_heading: True
 * /mobile_base/wheel_left_joint_name: wheel_left_joint
 * /mobile_base/wheel_right_joint_name: wheel_right_joint
 * /robot/name: turtlebot
 * /robot/type: turtlebot
 * /robot_description: <?xml version="1....
 * /robot_state_publisher/publish_frequency: 5.0
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /use_sim_time: False

NODES
  /
    bumper2pointcloud (nodelet/nodelet)
    cmd_vel_mux (nodelet/nodelet)
    diagnostic_aggregator (diagnostic_aggregator/aggregator_node)
    mobile_base (nodelet/nodelet)
    mobile_base_nodelet_manager (nodelet/nodelet)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)

auto-starting new master
process[master]: started with pid [6415]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to a22c211a-7888-11e9-8396-00044bcb943f
process[rosout-1]: started with pid [6426]
started core service [/rosout]
process[robot_state_publisher-2]: started with pid [6434]
process[diagnostic_aggregator-3]: started with pid [6435]
process[mobile_base_nodelet_manager-4]: started with pid [6440]
process[mobile_base-5]: started with pid [6444]
process[bumper2pointcloud-6]: started with pid [6448]
process[cmd_vel_mux-7]: started with pid [6451]
  • 启动键盘控制
roslaunch turtlebot_teleop keyboard_teleop.launch
  • 显示如下:
ubuntu@AiROS-XA:~$ roslaunch turtlebot_teleop keyboard_teleop.launch
... logging to /home/ubuntu/.ros/log/a22c211a-7888-11e9-8396-00044bcb943f/roslaunch-AiROS-XA-6533.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://AiROS-XA:41229/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.3
 * /turtlebot_teleop_keyboard/scale_angular: 1.5
 * /turtlebot_teleop_keyboard/scale_linear: 0.5

NODES
  /
    turtlebot_teleop_keyboard (turtlebot_teleop/turtlebot_teleop_key)

ROS_MASTER_URI=http://localhost:11311

process[turtlebot_teleop_keyboard-1]: started with pid [6552]

Control Your Turtlebot!
---------------------------
Moving around:
   u    i    o
   j    k    l
   m    ,    .

q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%
space key, k : force stop
anything else : stop smoothly

CTRL-C to quit

currently:  speed 0.2   turn 1 

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: turtlebot入门教程