宇立(sunrise instruments)FT-sensor SDK

 原文:

GitHub - thinkexist1989/SRI-FTSensor-SDK: C++ wrappper of the FT Sensor made by Sunrise Instruments.C++ wrappper of the FT Sensor made by Sunrise Instruments. - GitHub - thinkexist1989/SRI-FTSensor-SDK: C++ wrappper of the FT Sensor made by Sunrise Instruments.icon-default.png?t=N7T8https://github.com/thinkexist1989/SRI-FTSensor-SDK.git 介绍:SRI FTSensor SDK是Sunrise Instruments制作的FTSensor的跨平台c++封装。

依赖:SRI FTSensor SDK是一个仅头文件的库。但这取决于一些Boost lib。

        Boost.Asio 提供tcp ,串口通讯

还可以使用一些Boost头文件专用库,如lexical_cast、format和string_algo。

如果你使用的是类linux系统(例如Ubuntu), Boost可以通过包管理器轻松安装:

$ sudo apt install boost-all-dev

编译:您可以将所有头文件(在include目录中)放入您自己的项目中,并对其进行编译。在根目录中,有一个示例来展示如何使用这个SDK。在安装Boost库之后,您可以输入以下命令:

$ git clone https://github.com/thinkexist1989/SRI-FTSensor-SDK.git
$ cd SRI-FTSensor-SDK/
$ mkdir build && cd build
$ cmake ..
$ make -j`nproc`
$ ./test #Run the example

使用:1.在main.cpp中包含头文件

#include <sri/ftsensor.hpp> 
#include <sri/commethernet.hpp> // connection to the tcp-type FTSensor

#include <iostream>

int main() {
    ...
}

2.初始化与FTSensor的通信(我有一个ip 192.168.1.108的tcp类型传感器      

SRI::CommEthernet* ce = new SRI::CommEthernet("192.168.1.108", 4008);

3.通过通讯初始化传感器

SRI::FTSensor sensor(ce);

4。获取或设置一些参数

IpAddr ip = sensor.getIpAddress();

5.获取传感器实时数据

auto rtData = sensor.getRealTimeDataOnce<float>(rtMode,rtDataValid);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值