ros kinect 安装arbotix遇到问题

先说解决方案: 下载ros-indigo版本的arbotix功能包

今天对机器人在rviz中的仿真加入arbotix控制运动功能
ros-kinetic版本无法通过命令安装,所以我直接用书上的在github上直接下载了

git clone  https://github.com/vanadiumlabs/arbotix_ros.git

安装完后catkin_make通过,但是在使用launch文件的时候,却显示了错误:

Traceback (most recent call last):
  File "/home/wang/sim_robot/src/arbotix_ros/arbotix_python/bin/arbotix_driver", line 37, in <module>
    from arbotix_python.diff_controller import DiffController
  File "/home/wang/sim_robot/src/arbotix_ros/arbotix_python/src/arbotix_python/diff_controller.py", line 38, in <module>
    from tf.broadcaster import TransformBroadcaster
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf/__init__.py", line 28, in <module>
    from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
    from tf2_py import *
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
    from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)
[arbotix-1] process has died [pid 27556, exit code 1, cmd /home/wang/sim_robot/src/arbotix_ros/arbotix_python/bin/arbotix_driver __name:=arbotix __log:=/home/wang/.ros/log/8676e928-3712-11ec-a2c4-40e23067c567/arbotix-1.log].
log file: /home/wang/.ros/log/8676e928-3712-11ec-a2c4-40e23067c567/arbotix-1*.log
^C[rviz-4] killing on exit
[robot_state_publisher-3] killing on exit
[joint_state_publisher_gui-2] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

其中最主要的错误是:

ImportError: dynamic module does not define module export function (PyInit__tf2)

查看了一下,发现是python版本的问题,但是我在bashrc中屏蔽了python3,却无法还是无法launch成功,所以我在当前命令行下import一下试试,发现是可以引用:

wang@wang-X550JK:~$ python
Python 2.7.12 (default, Mar  1 2021, 11:38:31) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tf
>>> 

所以arbotix与tf python版本的不兼容问题就应该是arbotix功能包的问题了,进入github页面看看发现正常git的版本是noetic版本,本身就是适用于python3的,所以在网站上查看了其他版本,发现可以使用indigo版本的使用,见下图:
ros kinect 安装arbotix遇到问题_第1张图片
而indigo版本所适用的ros版本,包含了kinetic版本:

This repository contains the Arbotix ROS drivers. This branch supports ROS Indigo to Melodic.

所以直接在https://github.com/vanadiumlabs/arbotix_ros/tree/indigo-devel网站上下载indigo版本的(左边可以选择版本)。放在ros工作空间下可以编译后 launch成功,看下效果:
ros kinect 安装arbotix遇到问题_第2张图片
圆满解决,继续下一步去。。。。

你可能感兴趣的:(ros,ubuntu,ar,自动驾驶,人工智能,ubuntu)