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

3、启动gmapping

roslaunch husky_navigation gmapping_demo.launch

4、启动rviz

 

roslaunch husky_viz view_robot.launch

 

 

5、启动键盘控制

roslaunch turtlebot_teleop keyboard_teleop.launch

keyboard_teleop.launch 文件位置

 

需要修改速度映射:

<remap from="turtlebot_teleop_keyboard/cmd_vel" to="husky_velocity_controller/cmd_vel"/>

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

<launch>
  <!-- turtlebot_teleop_key already has its own built in velocity smoother -->
  <node pkg="turtlebot_teleop" type="turtlebot_teleop_key" name="turtlebot_teleop_keyboard"  output="screen">
    <param name="scale_linear" value="0.5" type="double"/>
    <param name="scale_angular" value="1.5" type="double"/>
    <!--remap from="turtlebot_teleop_keyboard/cmd_vel" to="cmd_vel_mux/input/teleop"/-->
    <!--remap from="turtlebot_teleop_keyboard/cmd_vel" to="cmd_vel_mux/input/teleop"/-->
    <!--remap from="turtlebot_teleop_keyboard/cmd_vel" to="cmd_vel"/-->
    <!--remap from="turtlebot_teleop_keyboard/cmd_vel" to="/gammabot_velocity_controller/cmd_vel"/-->
    <!--the following is the original code-->
    <remap from="turtlebot_teleop_keyboard/cmd_vel" to="husky_velocity_controller/cmd_vel"/>
    <!--the following control the kobuki mubile_base-->
	
    <!--turtlebot 仿真速度指令话题映射-->
    <!--remap from="turtlebot_teleop_keyboard/cmd_vel" to="/mobile_base/commands/velocity"/-->
    <!--remap from="turtlebot_teleop_keyboard/cmd_vel" to="/four_wheel_steering_controller/cmd_vel"/-->
  </node>
</launch>

 

 

6、Xbox摇杆控制

 

roslaunch turtlebot_teleop xbox360_teleop.launch

(1)<remap from="turtlebot_teleop_joystick/cmd_vel" to="husky_velocity_controller/cmd_vel"/>

(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<boost::exception_detail::error_info_injector<boost::lock_error> >'

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

 

原因

 

<arg name="world_file" default="/home/sdia/catkin_ws/src/turtlebot_gazebo/worlds/playground.world"/>

路径设置不对

 

 

使用环境文件是playgroud

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

 

  1. 启动键盘控制

roslaunch turtlebot_teleop keyboard_teleop.launch

 

需要修改速度映射:

<remap from="turtlebot_teleop_keyboard/cmd_vel" to="/mobile_base/commands/velocity"/>

 

 

  • 5
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值