ur5e机械臂末端添加dh_ag95夹爪(ubuntu20.04+ROSnoetic)

news2024/9/22 23:33:18

一、从官网上下载UR5e机械臂

mkdir -p catkin_ws
cd catkin_ws
git clone https://github.com/UniversalRobots/Universal_Robots_ROS_Driver.git src/Universal_Robots_ROS_Driver
git clone -b calibration_devel https://github.com/fmauch/universal_robot.git src/fmauch_universal_robot
git clone https://github.com/ros-industrial/ur_msgs.git src/ur_msgs
rosdep install --from-paths src --ignore-src -y
catkin_make

二、给机械臂添加夹爪

git clone https://github.com/DH-Robotics/dh_gripper_ros.git src/dh_gripper_ros

1、夹爪下载完之后再进行编译,这时候会报错,因为\下载的夹爪文件中程序是根据gazebo 7 版本设计的,如果gazebo版本不一样,删掉simulation的就可以了。

2、里面包含了其他型号夹爪的文件,可以直接删了这部分文件。

3、在下载好的夹爪文件中,打开dh_robotics_ag95_gripper/dh_robotics_ag95_description/urdf/dh_robotics_ag95_gripper.xacro,然后将下面几段代码注释掉并保存。

<?xml version="1.0" ?>

<robot name="dh_robotics_ag95_gripper" xmlns:xacro="http://ros.org/wiki/xacro">
    <xacro:include filename="$(find dh_robotics_ag95_description)/urdf/dh_robotics_ag95_gripper.urdf.xacro" />
    
    <!-- <gazebo>
        <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so"> 
            <robotNamespace>/</robotNamespace>
            <legacyModeNS>true</legacyModeNS>
        </plugin> 
    </gazebo>
    
    <link name="world"/>
    <joint name="world_fixed" type="fixed">
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <parent link="world"/>
        <child link="gripper_root_link"/>
    </joint>

    <link name="gripper_root_link">
        <visual>
            <origin xyz="0 0 0.5" rpy="0 0 0"/>
            <geometry>
                <box size="0.1 0.1 1.0"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0.5" rpy="0 0 0"/>
            <geometry>
                <box size="0.1 0.1 1.0"/>
            </geometry>
        </collision>
        <inertial>
            <mass value="1e2" />
            <origin xyz="0.0 0.0 0.0" />
            <inertia ixx = "0.000001" ixy = "0.000000" ixz = "0.000000"
                     iyx = "0.000000" iyy = "0.000001" iyz = "0.000000"
                     izx = "0.000000" izy = "0.000000" izz = "0.000001" />
        </inertial>
    </link>
    
    <xacro:dh_robotics_ag95_gripper prefix="" parent="gripper_root_link" >
        <origin xyz="0.05 0 0.85" rpy="${pi/2}  0 ${pi/2}"/>
    </xacro:dh_robotics_ag95_gripper> -->
    
</robot>

然后打开机械臂文件:打开fmauch_universal_robot/ur_description/urdf,修改ur5.xacro文件,如下所示:

<?xml version="1.0"?>
<robot xmlns:xacro="http://wiki.ros.org/xacro" name="ur5e_robot">
  <!--
    This is a convenience top-level xacro which loads the macro for the UR5e
    which defines the default values for the various "parameters files"
    parameters for a UR5e.

    This file is only useful when loading a stand-alone, completely isolated
    robot with only default values for all parameters such as the kinematics,
    visual and physical parameters and joint limits.

    This file is not intended to be integrated into a larger scene or other
    composite xacro.

    Instead, xacro:include 'inc/ur5e_macro.xacro' and override the defaults
    for the arguments to that macro.

    Refer to 'inc/ur_macro.xacro' for more information.
  -->
  <xacro:include filename="$(find ur_description)/urdf/inc/ur5e_macro.xacro"/>
  <xacro:ur5e_robot prefix="" />
  <xacro:include filename="$(find dh_robotics_ag95_description)/urdf/dh_robotics_ag95_gripper.xacro" />
 
  <!--dh_ag95_gripper-->
  <xacro:dh_robotics_ag95_gripper prefix="" parent="tool0" >
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </xacro:dh_robotics_ag95_gripper>
</robot>

打开fmauch_universal_robot/ur_description/launch,修改load_ur5.launch文件,代码如下所示:

<?xml version="1.0"?>
<launch>
  <!--ur5e parameters files -->
  <arg name="joint_limit_params" default="$(find ur_description)/config/ur5e/joint_limits.yaml"/>
  <arg name="kinematics_params" default="$(find ur_description)/config/ur5e/default_kinematics.yaml"/>
  <arg name="physical_params" default="$(find ur_description)/config/ur5e/physical_parameters.yaml"/>
  <arg name="visual_params" default="$(find ur_description)/config/ur5e/visual_parameters.yaml"/>
  <!--common parameters -->
  <arg name="transmission_hw_interface" default="hardware_interface/PositionJointInterface" />
  <arg name="safety_limits" default="false" doc="If True, enable the safety limits controller"/>
  <arg name="safety_pos_margin" default="0.15" doc="The lower/upper limits in the safety controller" />
  <arg name="safety_k_position" default="20" doc="Used to set k position in the safety controller" />

  <param name="robot_description" command="$(find xacro)/xacro $(find ur_description)/urdf/ur5e.xacro transmission_hw_interface:=$(arg transmission_hw_interface)" />

  <!-- use common launch file and pass all arguments to it -->
  <!-- <include file="$(find ur_description)/launch/load_ur.launch" pass_all_args="true"/> -->
</launch>

接着修改ur_gazebo/ur5_bringup.launch文件,代码如下所示:

<?xml version="1.0"?>
<launch>
  <!--
    Main entry point for loading a single UR5e into Gazebo, in isolation, in the
    empty world.

    A set of ros_control controllers similar to those loaded by ur_robot_driver
    will be loaded by 'ur_control.launch.xml' (note: *similar*, *not* identical).

    This bringup .launch file is intentionally given the same name as the one in
    the ur_robot_driver package, as it fulfills a similar role: loading the
    configuration and starting the necessary ROS nodes which in the end provide
    a ROS API to a Universal Robots UR5e. Only in this case, instead of a real
    robot, a virtual model in Gazebo is used.

    NOTE 1: as this is not a real robot, there are limits to the faithfulness
    of the simulation. Dynamic behaviour will be different from a real robot.
    Only a subset of topics, actions and services is supported. Specifically,
    interaction with the Control Box itself is not supported, as Gazebo does not
    simulate a Control Box. This means: no Dashboard server, no URScript topic
    and no force-torque sensor among other things.

    NOTE 2: users wishing to integrate a UR5e with other models into a more
    complex simulation should NOT modify this file. Instead, if it would be
    desirable to reuse this file with a custom simulation, they should create a
    copy and update this copy so as to accomodate required changes.

    In those cases, treat this file as an example, showing one way how a Gazebo
    simulation for UR robots *could* be launched. It is not necessary to mimic
    this setup completely.
  -->
  <include file="$(find ur_description)/launch/load_ur5e.launch"/>
  <rosparam file="$(find dh_robotics_ag95_gazebo)/controller/gripper_controller_dh_robotics.yaml" command="load"/>
  <node name="arm_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn arm_controller gripper" respawn="false" output="screen"/>
  <node name="gui_controller" pkg="rqt_joint_trajectory_controller" type="rqt_joint_trajectory_controller" />

  <!--Robot description and related parameter files -->
  <arg name="robot_description_file" default="$(dirname)/inc/load_ur5e.launch.xml" doc="Launch file which populates the 'robot_description' parameter."/>
  <arg name="joint_limit_params" default="$(find ur_description)/config/ur5e/joint_limits.yaml"/>
  <arg name="kinematics_params" default="$(find ur_description)/config/ur5e/default_kinematics.yaml"/>
  <arg name="physical_params" default="$(find ur_description)/config/ur5e/physical_parameters.yaml"/>
  <arg name="visual_params" default="$(find ur_description)/config/ur5e/visual_parameters.yaml"/>

  <!-- Controller configuration -->
  <arg name="controller_config_file" default="$(find ur_gazebo)/config/ur5e_controllers.yaml" doc="Config file used for defining the ROS-Control controllers."/>
  <arg name="controllers" default="joint_state_controller pos_joint_traj_controller" doc="Controllers that are activated by default."/>
  <arg name="stopped_controllers" default="joint_group_pos_controller" doc="Controllers that are initally loaded, but not started."/>

  <!-- robot_state_publisher configuration -->
  <arg name="tf_prefix" default="" doc="tf_prefix used for the robot."/>
  <arg name="tf_pub_rate" default="500" doc="Rate at which robot_state_publisher should publish transforms."/>

  <!-- Gazebo parameters -->
  <arg name="paused" default="false" doc="Starts Gazebo in paused mode" />
  <arg name="gui" default="true" doc="Starts Gazebo gui" />

  <!-- Load urdf on the parameter server -->
  <include file="$(arg robot_description_file)">
    <arg name="joint_limit_params" value="$(arg joint_limit_params)"/>
    <arg name="kinematics_params" value="$(arg kinematics_params)"/>
    <arg name="physical_params" value="$(arg physical_params)"/>
    <arg name="visual_params" value="$(arg visual_params)"/>
  </include>

  <!-- Robot state publisher -->
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="$(arg tf_pub_rate)" />
    <param name="tf_prefix" value="$(arg tf_prefix)" />
  </node>

  <!-- Start the 'driver' (ie: Gazebo in this case) -->
  <include file="$(dirname)/inc/ur_control.launch.xml">
    <arg name="controller_config_file" value="$(arg controller_config_file)"/>
    <arg name="controllers" value="$(arg controllers)"/>
    <arg name="gui" value="$(arg gui)"/>
    <arg name="paused" value="$(arg paused)"/>
    <arg name="stopped_controllers" value="$(arg stopped_controllers)"/>
  </include>
</launch>

最后编译代码

cd catkin_ws
catkin_make
cd src
source devel/setup.bash
roslaunch ur_description view_ur5e.launch

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1915796.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Vue3入门之创建vue3的单页应用(vite+vue)

天行健&#xff0c;君子以自强不息&#xff1b;地势坤&#xff0c;君子以厚德载物。 每个人都有惰性&#xff0c;但不断学习是好好生活的根本&#xff0c;共勉&#xff01; 文章均为学习整理笔记&#xff0c;分享记录为主&#xff0c;如有错误请指正&#xff0c;共同学习进步。…

电机学-绪论

绪论 电机&#xff1a;根据电磁感应定律和电磁力定律实现机电能量转换和信号传递与转换的电磁机械装置。 电磁感应定律&#xff1a; BiliBili: 法拉第电磁感应定律 BiliBili: 楞次定律 BiliBili: 左手定则、右手定则、右手螺旋定则

GOLLIE : ANNOTATION GUIDELINES IMPROVE ZERO-SHOT INFORMATION-EXTRACTION

文章目录 题目摘要引言方法实验消融 题目 Gollie&#xff1a;注释指南改进零样本信息提取 论文地址&#xff1a;https://arxiv.org/abs/2310.03668 摘要 大型语言模型 (LLM) 与指令调优相结合&#xff0c;在泛化到未见过的任务时取得了重大进展。然而&#xff0c;它们在信息提…

【昇思25天学习打卡营打卡指南-第十八天】基于MobileNetv2的垃圾分类

基于MobileNetv2的垃圾分类 MobileNetv2模型原理介绍 MobileNet网络是由Google团队于2017年提出的专注于移动端、嵌入式或IoT设备的轻量级CNN网络&#xff0c;相比于传统的卷积神经网络&#xff0c;MobileNet网络使用深度可分离卷积&#xff08;Depthwise Separable Convolut…

玩机社区系统源码 | 2024年最美社区源码 全开源 带后端

简介&#xff1a; 玩机社区系统源码 | 2024年最美社区源码 全开源 带后端 图片&#xff1a; 点击下载

“Pandas数据处理与分析:实用技巧与应用“

目录 # 开篇 1. pandas的series的了解 1.1 pd.Series 创建 1.2 pd.series 的索引使用 1.3 pd.series 之字典/索引 1.4 pandas 转换数据类型 1.5 pandas 通过索引或者通过位置来取值 1.6 pandas 指定行取值 1.7 pands之Series 切片和索引 1.8 pands之Series 的索引和值…

火热夏季:浦语*书生InternLM大模型实战闯关-入门岛之Linux基础知识

一、ssh链接与端口映射并运行hello_wold.py 1.创建开发机 InternStudio创建开发机 2.进入开发机 3.Ssh链接开发机 powerShell终端ssh链接开发机。 4.创建一个hello_world.py文件web demo 5.运行web demo 6.端口映射 7.本地浏览器打开web 二、 VSCODE 远程连接开发机并创建一个…

Mac 上安转文字转 SQL 利器 WrenAI

WrenAI 是一个开源的 Text-SQL 的工具&#xff0c;通过导入数据库结构&#xff0c;通过提问的方式生成 SQL。本文将讲述如何在 MacOS 上安装 WrenAI。要运行WrenAI&#xff0c;首先需要安装 Docker 桌面版。 下载 WrenAI https://github.com/Canner/WrenAI/releases/tag/0.7.…

Spring Boot 高级配置:如何轻松定义和读取自定义配置

目录 1. 环境准备 2. 读取配置数据 2.1 使用 Value注解 2.2 Environment对象 2.3.2.3 自定义对象 这篇博客我们将深入探讨如何在Spring Boot应用中有效地定义和读取自定义配置。掌握这一技巧对于任何希望优化和维护其应用配置的开发者来说都是至关重要的。我们将从基础开始…

HTTPS理解

一个完整的HTTP连接 TCP三次握手接受窗口发送数据关闭连接 接受窗口是用来做什么呢&#xff1f; 它根据自身网络情况设置不同大小的值用来控制对方发送速度&#xff0c;避免对方发送太快&#xff0c;导致网络拥塞。 为什么TCP握手要三次&#xff1f; 1&#xff09;确认双方的…

镭速Raysync vs MASV:哪个才最合适企业大文件传输

在当前信息爆炸的时代&#xff0c;企业面临的一个关键挑战是如何高效、安全地传输日益增长的大量文件。选择正确的文件传输工具对于企业的日常运作至关重要。本文旨在对比分析两款备受瞩目的企业级大文件传输解决方案——镭速Raysync和MASV&#xff0c;以助企业决策者挑选出最适…

图像中高频信息、低频信息与ComfyUI中图像细节保留的简单研究

&#x1f9f5;背景 在做AI绘图的时候&#xff0c;经常有一些图像的细节需要保留原始图像内容&#xff0c;比如说衣服的细节&#xff0c;商品的文字标签等等&#xff0c;如果这些地方发生了变化&#xff0c;就会导致生成的结果无法直接商用&#xff0c;而让生成的图像完全保留原…

加速你的下载,IDM神器不可错过!快如闪电,稳如老狗

嗨&#xff0c;各位小伙伴&#xff01;&#x1f44b;&#x1f44b;&#x1f44b; 今天我要安利一个让你的下载体验起飞的神奇工具——Internet Download Manager&#xff08;简称IDM&#xff09;&#x1f6eb;。想象一下网速慢得像蜗牛爬的场景&#xff0c;是不是让人抓狂&…

3个方法教你如果快速绕过Excel工作表保护密码

在日常生活中&#xff0c;我们可能会遇到一些特殊情况&#xff0c;比如不小心忘记了Excel文件中设置的打开密码。别担心&#xff01;这里为您带来一份详细的Excel文件密码移除教程&#xff0c;助您轻松绕过Excel工作表保护。 方法一&#xff1a;使用备份文件 如果您有文件的备…

24暑假计划

暑假计划&#xff1a; 1.从明天起开始将C语言的部分补充完整&#xff0c;这部分的预计在7月24日前完成 2.由于之前的文章内容冗余&#xff0c;接下来进行C语言数据结构的重新编写和后面内容的补充预计8月10号前完成 3.后续开始C的初级学习

【热梗案例】知识点阶段性综合汇总

文章目录 渲染对象、实现统计功能实现删除功能设置发布按钮实现发布按钮的提交功能 直接用CSS的模板&#xff0c;模板代码如下&#xff1a; <template><view class"title">近期热梗</view><view class"out"> <view class&qu…

SuperCLUE最新测评发布,360智脑大模型稳居大模型第一梯队

7月9日&#xff0c;国内权威大模型评测机构SuperCLUE发布《中文大模型基准测评2024上半年报告》&#xff0c;360智脑大模型&#xff08;360gpt2-pro&#xff09;在SuperCLUE基准6月测评中&#xff0c;取得总分72分&#xff0c;超过GPT-3.5-Turbo-0125&#xff0c;位列国内大模型…

马蹄集 oj赛(双周赛7.3-7.14)

目录 围栏木桩 大厨小码哥 最长子段和 旅费 散步 抽奖 海龟 线段树 纸带 异或和 上楼梯 上楼梯2 围栏木桩 难度:黄金时间限制:1秒四占用内存:128 M 某农场有一个由按编号排列的 ,,根木桩构成的首尾不相连的围栏。现要在这个围栏中选取一些太桩&#xff0c;按照原有…

PHP 安装Memcached 扩展 PHP使用Memcache

memcache扩展下载 访问官网&#xff1a;https://pecl.php.net/package/memcache&#xff0c;下载合适的memcache版本的安装包&#xff0c;注意要与php版本相匹配。 1、查看运行环境php版本,可以运行以下代码 <?php phpinfo(); ?>2、查看版本信息以及是否支持多线程…

YOLOv5改进 | 注意力机制| 对密集和小目标友好的EVAblock【完整代码 + 小白轻松上手】

秋招面试专栏推荐 &#xff1a;深度学习算法工程师面试问题总结【百面算法工程师】——点击即可跳转 &#x1f4a1;&#x1f4a1;&#x1f4a1;本专栏所有程序均经过测试&#xff0c;可成功执行&#x1f4a1;&#x1f4a1;&#x1f4a1; 专栏目录&#xff1a; 《YOLOv5入门 改…