ArbotiX+RVIZ环境搭建和仿真

29 篇文章 4 订阅

环境:ubuntu18

安装ArbotiX控制器

sudo apt-get install ros-indigo-arbotix
sudo apt-get install ros-indigo-arbotix-*

编辑launch文件

新增加2个文件:
arbotix_mybot_with_laser.launch
fake_mybot_arbotix.yaml

mybot_description/
├── CMakeLists.txt
├── config
│   ├── fake_mybot_arbotix.yaml
│   └── mybot_urdf.rviz
├── launch
│   ├── arbotix
│   │   └── arbotix_mybot_with_laser.launch
│   └── xacro
│       ├── display_mybot_base_xacro.launch
│       └── display_mybot_with_laser.launch
├── package.xml
└── urdf
    ├── urdf
    │   ├── mybot_base.urdf
    │   └── mybot_with_laser.urdf
    └── xacro
        ├── laser.xacro
        ├── mybot_base.xacro
        ├── mybot_with_laser.xacro
        └── mybot.xacro

arbotix_mybot_with_laser.launch:

<launch>
	<param name="/use_sim_time" value="false" />

    <!-- 加载机器人URDF/Xacro模型 -->
    <arg name="model" default="$(find xacro)/xacro --inorder '$(find mybot_description)/urdf/xacro/mybot_with_laser.xacro'" />
    <arg name="gui" default="true" />
    
    <param name="robot_description" command="$(arg model)" />
    
	<!-- 设置GUI参数,显示关节控制插件 -->
    <param name="use_gui" value="$(arg gui)"/>
    
    <!-- arbotix -->
	<node name="arbotix" pkg="arbotix_python" type="arbotix_driver" output="screen">
        <rosparam file="$(find mybot_description)/config/fake_mybot_arbotix.yaml" command="load" />
        <param name="sim" value="true"/>
    </node>
    
    <!-- 运行joint_state_publisher节点,发布机器人的关节状态  -->
    <node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
    
    <!-- 运行robot_state_publisher节点,发布tf  -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
        <param name="publish_frequency" type="double" value="20.0" />
    </node>
    
    <!-- 运行rviz可视化界面 -->
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(find mybot_description)/config/mybot_urdf.rviz" required="true" />

</launch>

fake_mybot_arbotix.yaml:

controllers: {
  base_controller: {
    type: diff_controller, 
    base_frame_id: base_footprint, 
    base_width: 0.26, 
    ticks_meter: 4100, 
    Kp: 12, 
    Kd: 12, 
    Ki: 0, 
    Ko: 50, 
    accel_limit: 1.0 }
}

运行launch文件

roslaunch mybot_description arbotix_mybot_with_laser.launch
ubuntu@ubuntu-vpv:~$ rostopic list 
/clicked_point
/cmd_vel
/diagnostics
/initialpose
/joint_states
/move_base_simple/goal
/odom
/rosout
/rosout_agg
/tf
/tf_static

发布速度

ubuntu@ubuntu-vpv:~$ rostopic pub /cmd_vel geometry_msgs/Twist "linear:
  x: 0.3
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 0.3"

在这里插入图片描述
疑问:

Joint state with name: "base_l_wheel_joint" was received but not found in URDF
在这里插入图片描述

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值