写在文章前:本文分享3Dconnexion鼠标安装ros包,此安装环境为ubuntu18.04下的ROS(1.14.10),本文不再讲述如何安装ROS系统和ubuntu系统,对于阅读者的ROS水平有一定的要求。本人也是ROS的初学者,对于错误的地方还望指正,愿共同进步!
安装鼠标ROS驱动包
参考文章: http://wiki.ros.org/spacenav_node
(请根据自身的ubuntu选择不同版本的选项)
1.安装
在终端中依次输入以下两条指令
sudo apt install spacenavd
sudo apt install ros-melodic-spacenav-node
2.使用
在终端中输入以下指令以代开鼠标的驱动
roslaunch space_node classic.launch
3.分发topic
-
spacenav/offset
(geometry_msgs/Vector3)
Publishes the linear component of the joystick’s position. Approximately normalized to a range of -1 to 1. -
spacenav/rot_offset
(geometry_msgs/Vector3)
Publishes the angular component of the joystick’s position. Approximately normalized to a range of -1 to 1. -
spacenav/twist
(geometry_msgs/Twist)
Combines offset and rot_offset into a single message. -
spacenav/joy
(sensor_msgs/Joy)
Outputs the spacenav’s six degrees of freedom and its buttons as a joystick message.
举例:
rostopic echo /spacenav/joy
输入此命令后,摇动3D鼠标摇杆,输出axis各值。
4.报错解决
安装ros-melodic-spacenav-node时出现错误
参考文章: https://blog.csdn.net/asdli/article/details/91978069