赞
踩
最近系统重装,重新配置仿真环境,因此再次梳理一下
假设ubuntu16中已经安装完ros-kinetic.
建立ros工作空间:
source /opt/ros/kinetic/setup.bash sh creat_pkg.sh mkdir -p ~/ros_gazebo/src cd ~/ros_gazebo catkin_make source ~/ros_gazebo/devel/setup.bash echo $ROS_PACKAGE_PATH #输出/home/jk/ros_gazebo/src:/opt/ros/kinetic/share新建package:
cd ~/ros_gazebo/src/ catkin_create_pkg my_ros_sim std_msgs rospy roscpp cd ~/ros_gazebo/ catkin_make运行以下命令,看看是否缺少一些包。
roslaunch turtlebot_gazebo turtlebot_world.launch roslaunch turtlebot_teleop keyboard_teleop.launch roslaunch turtlebot_gazebo gmapping_demo.launch roslaunch turtlebot_rviz_launchers view_navigation.launch安装对应的缺少的包到src下(turtlebot_simulator包含turtlebot_gazebo,turtlebot_interactions包含turtlebot_rviz_launchers)
cd ~/ros_gazebo/src git clone https://github.com/turtlebot/turtlebot_simulator.git git clone https://github.com/turtlebot/turtlebot.git git clone https://github.com/turtlebot/turtlebot_interactions.git编译:
#可能需要安装以下包 sudo apt-get install ros-kinetic-joy catkin_make
下载:gazebo_model,并解压到~/.gazebo下,如下图:
- cd ~/.gazebo/
- tar -xzvf models.tar.gz
- <launch>
- <!--有修改-->
- <arg name="gui" default="true"/>
- <arg name="world_file" default="$(env TURTLEBOT_GAZEBO_WORLD_FILE)"/>
-
- <arg name="base" value="$(optenv TURTLEBOT_BASE kobuki)"/> <!-- create, roomba -->
- <arg name="battery" value="$(optenv TURTLEBOT_BATTERY /proc/acpi/battery/BAT0)"/> <!-- /proc/acpi/battery/BAT0 -->
- <arg name="stacks" value="$(optenv TURTLEBOT_STACKS hexagons)"/> <!-- circles, hexagons -->
- <!--<arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR kinect)"/> --> <!-- kinect, asus_xtion_pro -->
- <!--有修改-->
- <arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR hokuyo)"/>
-
- <include file="$(find gazebo_ros)/launch/empty_world.launch">
- <arg name="use_sim_time" value="true"/>
- <arg name="debug" value="false"/>
- <arg name="gui" value="$(arg gui)" />
- <arg name="world_name" value="$(arg world_file)"/>
- </include>
-
- <include file="$(find turtlebot_gazebo)/launch/includes/$(arg base).launch.xml">
- <arg name="base" value="$(arg base)"/>
- <arg name="stacks" value="$(arg stacks)"/>
- <arg name="3d_sensor" value="$(arg 3d_sensor)"/>
- </include>
-
- <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
- <param name="publish_frequency" type="double" value="30.0" />
- </node>
-
- <!-- Fake laser -->
- <node pkg="nodelet" type="nodelet"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。