Universal_Robots_Client_Library 使用教程

Universal_Robots_Client_Library 使用教程

Universal_Robots_Client_LibraryA C++ library for accessing the UR interfaces that facilitate the use of UR robotic manipulators by external applications.项目地址:https://gitcode.com/gh_mirrors/un/Universal_Robots_Client_Library

1. 项目的目录结构及介绍

Universal_Robots_Client_Library/
├── CMakeLists.txt
├── LICENSE
├── README.md
├── include/
│   └── ur_client_library/
│       ├── comm/
│       ├── logging/
│       ├── primary/
│       ├── secondary/
│       └── types.h
├── src/
│   ├── comm/
│   ├── logging/
│   ├── primary/
│   ├── secondary/
│   └── urcl_log.cpp
└── examples/
    ├── example_program_control/
    ├── example_rtde_control/
    └── example_script_command/
  • CMakeLists.txt: 项目的构建配置文件。
  • LICENSE: 项目的许可证文件。
  • README.md: 项目的说明文档。
  • include/: 包含项目的头文件,分为多个子目录,如 comm, logging, primary, secondary 等。
  • src/: 包含项目的源代码文件,与头文件目录结构对应。
  • examples/: 包含项目的示例程序,如 example_program_control, example_rtde_control, example_script_command 等。

2. 项目的启动文件介绍

项目的启动文件通常位于 examples/ 目录下,例如 example_program_control/main.cpp。以下是一个示例启动文件的简要介绍:

#include <ur_client_library/ur/robot_state_helper.h>
#include <ur_client_library/comm/pipeline.h>
#include <ur_client_library/comm/producer.h>
#include <ur_client_library/comm/consumer.h>

int main(int argc, char** argv) {
    // 初始化通信管道
    urcl::comm::Pipeline pipeline;
    
    // 创建生产者和消费者
    std::unique_ptr<urcl::comm::Producer> producer = std::make_unique<urcl::comm::URProducer>();
    std::unique_ptr<urcl::comm::Consumer> consumer = std::make_unique<urcl::comm::URConsumer>();
    
    // 将生产者和消费者添加到管道中
    pipeline.setProducer(std::move(producer));
    pipeline.addConsumer(std::move(consumer));
    
    // 启动管道
    pipeline.run();
    
    return 0;
}

该启动文件展示了如何初始化通信管道,创建生产者和消费者,并将它们添加到管道中,最后启动管道。

3. 项目的配置文件介绍

项目的配置文件通常位于项目的根目录或 config/ 目录下。以下是一个示例配置文件的简要介绍:

robot_ip: "192.168.56.101"
reverse_port: 50001
script_sender_port: 50002
rtde_output_recipe_file: "rtde_output_recipe.txt"
rtde_input_recipe_file: "rtde_input_recipe.txt"
  • robot_ip: 机器人控制器的IP地址。
  • reverse_port: 反向通信端口。
  • script_sender_port: 脚本发送端口。
  • rtde_output_recipe_file: RTDE输出配方文件路径。
  • rtde_input_recipe_file: RTDE输入配方文件路径。

这些配置文件用于设置与机器人控制器的通信参数和端口信息。

Universal_Robots_Client_LibraryA C++ library for accessing the UR interfaces that facilitate the use of UR robotic manipulators by external applications.项目地址:https://gitcode.com/gh_mirrors/un/Universal_Robots_Client_Library

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王海高Eudora

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值