当前位置:   article > 正文

移动机器人仿真梳理_the kobuki robot

the kobuki robot

最近系统重装,重新配置仿真环境,因此再次梳理一下

假设ubuntu16中已经安装完ros-kinetic.

1、仿真环境配置

建立ros工作空间:

  1. source /opt/ros/kinetic/setup.bash
  2. sh creat_pkg.sh
  3. mkdir -p ~/ros_gazebo/src
  4. cd ~/ros_gazebo
  5. catkin_make
  6. source ~/ros_gazebo/devel/setup.bash
  7. echo $ROS_PACKAGE_PATH
  8. #输出/home/jk/ros_gazebo/src:/opt/ros/kinetic/share

新建package:

  1. cd ~/ros_gazebo/src/
  2. catkin_create_pkg my_ros_sim std_msgs rospy roscpp
  3. cd ~/ros_gazebo/
  4. catkin_make

运行以下命令,看看是否缺少一些包。

  1. roslaunch turtlebot_gazebo turtlebot_world.launch
  2. roslaunch turtlebot_teleop keyboard_teleop.launch
  3. roslaunch turtlebot_gazebo gmapping_demo.launch
  4. roslaunch turtlebot_rviz_launchers view_navigation.launch

安装对应的缺少的包到src下(turtlebot_simulator包含turtlebot_gazebo,turtlebot_interactions包含turtlebot_rviz_launchers)

  1. cd ~/ros_gazebo/src
  2. git clone https://github.com/turtlebot/turtlebot_simulator.git
  3. git clone https://github.com/turtlebot/turtlebot.git
  4. git clone https://github.com/turtlebot/turtlebot_interactions.git

编译:

  1. #可能需要安装以下包
  2. sudo apt-get install ros-kinetic-joy
  3. catkin_make

 

2、下载model,修改launch

下载:gazebo_model,并解压到~/.gazebo下,如下图:

  1. cd ~/.gazebo/
  2. tar -xzvf models.tar.gz

2.1 修改turtlebot_world.launch

  1. <launch>
  2. <!--有修改-->
  3. <arg name="gui" default="true"/>
  4. <arg name="world_file" default="$(env TURTLEBOT_GAZEBO_WORLD_FILE)"/>
  5. <arg name="base" value="$(optenv TURTLEBOT_BASE kobuki)"/> <!-- create, roomba -->
  6. <arg name="battery" value="$(optenv TURTLEBOT_BATTERY /proc/acpi/battery/BAT0)"/> <!-- /proc/acpi/battery/BAT0 -->
  7. <arg name="stacks" value="$(optenv TURTLEBOT_STACKS hexagons)"/> <!-- circles, hexagons -->
  8. <!--<arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR kinect)"/> --> <!-- kinect, asus_xtion_pro -->
  9. <!--有修改-->
  10. <arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR hokuyo)"/>
  11. <include file="$(find gazebo_ros)/launch/empty_world.launch">
  12. <arg name="use_sim_time" value="true"/>
  13. <arg name="debug" value="false"/>
  14. <arg name="gui" value="$(arg gui)" />
  15. <arg name="world_name" value="$(arg world_file)"/>
  16. </include>
  17. <include file="$(find turtlebot_gazebo)/launch/includes/$(arg base).launch.xml">
  18. <arg name="base" value="$(arg base)"/>
  19. <arg name="stacks" value="$(arg stacks)"/>
  20. <arg name="3d_sensor" value="$(arg 3d_sensor)"/>
  21. </include>
  22. <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
  23. <param name="publish_frequency" type="double" value="30.0" />
  24. </node>
  25. <!-- Fake laser -->
  26. <node pkg="nodelet" type="nodelet"
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/792818
推荐阅读
相关标签
  

闽ICP备14008679号