ros melodic控制真实机械臂之openmanipulator参考

目录

一、源码下载及编译

1、相关参考网站

2、创建工作空间及源码下载

二、对openmanipulator进行仿真


前面的一段时间,针对自己的机器人做了模型配置moveit配置等,但想真正的实现真是机器人还有很远的举例,自己也没有成熟的经验,所以参考成熟的产品及相应源码,肯定会有所帮助,本文记录了编译openmanipulator相关源码的详细过程及注意事项。

一、源码下载及编译

1、相关参考网站

(1)、创客智造:https://www.ncnynl.com/archives/201903/2849.html

(2)、openmanipulator官网:https://emanual.robotis.com/docs/en/platform/openmanipulator_x/overview/#overview

2、创建工作空间及源码下载

        (1)参考网站里面由详细介绍,但为了查阅方便,这里也简要记录以下。首先安装如下相关功能包:

sudo apt-get install ros-melodic-ros-controllers ros-melodic-gazebo* ros-melodic-moveit* ros-melodic-industrial-core

        (2)然后用如下方式创建工作空间。

cd ~
mkdir -p catkin_ws/src

        (3)按照如下方式下载源码并进行编译,注意下载源码时将https换为git速度可能会快一点

cd ~/catkin_ws/src/
git clone git://github.com/ROBOTIS-GIT/DynamixelSDK.git
git clone git://github.com/ROBOTIS-GIT/dynamixel-workbench.git
git clone git://github.com/ROBOTIS-GIT/dynamixel-workbench-msgs.git
git clone git://github.com/ROBOTIS-GIT/open_manipulator.git
git clone git://github.com/ROBOTIS-GIT/open_manipulator_msgs.git
git clone git://github.com/ROBOTIS-GIT/open_manipulator_simulations.git
git clone git://github.com/ROBOTIS-GIT/robotis_manipulator.git
git clone git://github.com/ROBOTIS-GIT/open_manipulator_applications.git
git clone git://github.com/ROBOTIS-GIT/open_manipulator_controls.git
cd ~/catkin_ws && catkin_make
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

        (4)编译问题

        如果能正常编译,那是最好,但如果安装了anoconda软件,又可能会存在报“uuid_generate@UUID_1.0”错误的情况,这里记录遇到这种问题时的解决办法,如下,其中,xxx表示用户名。具体可查看该博客,记录得比较详细。

sudo rm /home/xxx/anaconda3/lib/libuuid.so.1
sudo ln -s /lib/x86_64-linux-gnu/libuuid.so.1 /home/xxx/anaconda3/lib/libuuid.so.1

二、对openmanipulator进行仿真

        由于是进行仿真,为了方便输入,这里将open_manipulator包下面的open_manipulator_controller文件夹下面的open_manipulator_controller.launch文件做了如下修改:

<launch>
  <arg name="usb_port"     default="/dev/ttyUSB0"/>
  <arg name="baud_rate"    default="1000000"/>
  <arg name="control_period"         default="0.010"/>
  <arg name="use_platform"           default="false"/>  <!-- true for actual, false for simulation -->

  <node name="open_manipulator_controller" pkg="open_manipulator_controller" type="open_manipulator_controller" 
    output="screen" args="$(arg usb_port) $(arg baud_rate)">
    <param name="control_period"       value="$(arg control_period)"/>
    <param name="using_platform"       value="$(arg use_platform)"/>
  </node>
</launch>

然后在三个窗口中分别输入如下命令,即可通过其GUI控制gazebo中的机械臂。

第一个窗口:

roslaunch open_manipulator_controller open_manipulator_controller.launch

第二个窗口打开gazebo:

roslaunch open_manipulator_gazebo open_manipulator_gazebo.launch

第三个窗口打开控制界面:

roslaunch open_manipulator_control_gui open_manipulator_control_gui.launch

        然后会由如下操作界面,完成图中标的两步后,所见及所得,通过该界面即可控制gazebo中的仿真模型运动:

        openmanipulator的功能远不止这些,肯定还需要进一步探索,但通过学习该开源项目并灵活用到自己的项目中,才是最重要的,这里仅仅是记录,方便自己以后查阅,同时,如果对遇到相同问题的同志有所启发,那是更好,对文中提到的链接表示感谢。

  • 5
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
你可以使用ROS-Melodic和MoveIt来进行UR5机械臂仿真控制。以下是一个基本的步骤: 1. 安装ROS-Melodic:请根据ROS官方文档的说明安装ROS-Melodic。确保你的系统满足所有的依赖项。 2. 安装MoveIt:在终端中运行以下命令来安装MoveIt: ``` sudo apt-get install ros-melodic-moveit ``` 3. 配置工作空间:创建一个新的工作空间,并将其初始化为ROS工作空间。例如,你可以运行以下命令: ``` mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ catkin_make ``` 4. 下载UR5机械臂包:在终端中运行以下命令来下载UR5机械臂ROS软件包: ``` cd ~/catkin_ws/src git clone https://github.com/ros-industrial/universal_robot.git ``` 5. 下载MoveIt配置文件:在终端中运行以下命令来下载MoveIt配置文件: ``` cd ~/catkin_ws/src git clone https://github.com/ros-planning/moveit_resources.git ``` 6. 构建和编译:在终端中运行以下命令来构建和编译你的工作空间: ``` cd ~/catkin_ws/ catkin_make ``` 7. 启动仿真环境:在终端中运行以下命令来启动UR5机械臂仿真环境: ``` roslaunch ur_gazebo ur5.launch ``` 8. 启动MoveIt RViz:在终端中运行以下命令来启动MoveIt RViz界面: ``` roslaunch ur5_moveit_config moveit_rviz.launch config:=true ``` 9. 进行控制:在RViz界面中,你可以使用MoveIt插件来规划和控制UR5机械臂的运动。你可以设置目标位置、执行运动等。 这些是基本的步骤,可以帮助你开始使用ROS-Melodic和MoveIt进行UR5机械臂仿真控制。你可以根据自己的需求进行进一步的定制和开发。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值