gazebo_ros碰撞传感器仿真:
1. 使用的插件:filename="libgazebo_ros_bumper.so"
相关链接:
Accurate bumper simulation - Gazebo: Q&A Forum
Adding ros integrated contact sensors - Gazebo: Q&A Forum类似于上一个链接的实现过程
Gazebo contact sensor added to a robot link in urdf file is not working as expected? - Gazebo: Q&A Forum有效:注意urdf的link中如果给collision起名为例如contact_link_collision而且必须是_collision结尾),则gazebo文件中的sensor里的<contact>需要填写标签contact_link_collision_collision。
以下格式成功输出信息
gazebo_msgs/ContactsState
只有作为传感器使用link与其它物体真正碰撞时,states不是空值,而且contact_positions绝对坐标信息只能返回接触点;
如有必要,可进一步开发并返回接触点的相对坐标信息。
2. 本地版本的编译bumper插件时,遇到以下错误:
error: #error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer headers. Please regenerate this file with a newer version of protoc.
经搜索是个protoc旧版本的问题,类似的问题和解决方案:
This file was generated by an older version of protoc - Gazebo: Q&A Forum
$ cd /usr/local/include/google
sudo rm -rf protobuf
- Go, download
protobuf-2.6.1
fromhereand extract the contents. (I downloadedprotobuf-2.6.1.tar.gz
) -
I followed the installation instructions givenhere. Which are:
$ ./autogen.sh
$ ./configure
$ make
$ make check
$ sudo make install
$ sudo dconfig
-
Right now I'm able to compile my workspace without a problem.
3. 安装FreeCAD,画出想要模拟碰撞传感器的部件形状:比如两个四分之一圆的弧形代表扫地机器人的碰撞传感器部件(两个是因为有两个触发点),在两个弧形部件上分别插入一个bumper插件即可模拟两个碰撞传感器。