ROS Gazebo仿真 测试步骤

turtlebot 的gazebo地图有点定位不对(忘了什么原因),改用husky,步骤如下:

 

1、下载展开(husky github)、catkin_make编译、source 路径

2、启动仿真

source ~/husky/devel/setup.bash

roslaunch husky_gazebo husky_playpen.launch

如果提示错误:

ERROR: cannot launch node of type [interactive_marker_twist_server/marker_server]: interactive_marker_twist_server

安装:sudo apt-get install ros-kinetic-interactive-marker-twist-server

ROS Gazebo仿真 测试步骤_第1张图片

ROS Gazebo仿真 测试步骤_第2张图片

3、启动gmapping

roslaunch husky_navigation gmapping_demo.launch

ROS Gazebo仿真 测试步骤_第3张图片

4、启动rviz

 

roslaunch husky_viz view_robot.launch

 

ROS Gazebo仿真 测试步骤_第4张图片

 

5、启动键盘控制

roslaunch turtlebot_teleop keyboard_teleop.launch

ROS Gazebo仿真 测试步骤_第5张图片

keyboard_teleop.launch 文件位置

ROS Gazebo仿真 测试步骤_第6张图片

 

需要修改速度映射:

速度不要太快,角速度0.1 线速度0.2左右


  
  
    
    
    
    
    
    
    
    
    
	
    
    
    
  

 

 

ROS Gazebo仿真 测试步骤_第7张图片

6、Xbox摇杆控制

 

roslaunch turtlebot_teleop xbox360_teleop.launch

(1)

(2)操控时注意必须按下LB键 jstest-gtk测试 4 号button , 由axis_deadman" value="4" 指定

 

(3)错误Couldn't open joystick force feedback! 可以忽略

 

 

 

 

 

 

 

以下为turtlebot gazebo仿真

 

 

从https://github.com/turtlebot/turtlebot_simulator下载,解压将 turtlebot_gazebo 目录复制到catkin_ws/src下,然编译

 

2、修改playground.world文件

gazebo playground.world

 

 

 

启动turtlebot仿真,roslaunch turtlebot_gazebo turtlebot_world.launch

 

出现错误

 

[ INFO] [1575341572.758603545]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...

terminate called after throwing an instance of 'boost::exception_detail::clone_impl >'

what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument

Aborted (core dumped)

[gazebo-2] process has died [pid 11321, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode ~/catkin_ws/src/turtlebot_gazebo/worlds/playground.world __name:=gazebo __log:=/home/sdia/.ros/log/fe609966-1577-11ea-9534-6014b3c8843b/gazebo-2.log].

log file: /home/sdia/.ros/log/fe609966-1577-11ea-9534-6014b3c8843b/gazebo-2*.log

 

原因

 

路径设置不对

 

 

使用环境文件是playgroud

ROS Gazebo仿真 测试步骤_第8张图片

该文件保存在系统变量$TURTLEBOT_GAZEBO_WORLD_FILE中。

 

  1. 启动键盘控制

roslaunch turtlebot_teleop keyboard_teleop.launch

 

需要修改速度映射:

ROS Gazebo仿真 测试步骤_第9张图片

 

 

你可能感兴趣的:(ROS)