0 Star 0 Fork 1

ianaxe/vrpn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vrpn_Tracker_NovintFalcon.h 2.57 KB
一键复制 编辑 原始数据 按行查看 历史
// -*- c++ -*-
// This file provides an interface to a Novint Falcon.
// http://home.novint.com/products/novint_falcon.php
// It uses libnifalcon to communicate with the device.
// http://libnifalcon.nonpolynomial.org/
//
// file: vrpn_Tracker_NovintFalcon.h
// author: Axel Kohlmeyer akohlmey@gmail.com 2010-04-14
// copyright: (C) 2010 Axel Kohlmeyer
// license: Released to the Public Domain.
// depends: libnifalcon-1.0.1, libusb-1.0, VRPN 07_26
// tested on: Linux x86_64 w/ gcc 4.4.1
#ifndef __TRACKER_NOVINTFALCON_H
#define __TRACKER_NOVINTFALCON_H
#include "vrpn_Configure.h" // IWYU pragma: keep
#if defined(VRPN_USE_LIBNIFALCON)
#include "vrpn_Tracker.h"
#include "vrpn_Button.h"
#include "vrpn_ForceDevice.h"
// Forward declaration for proxy class that wraps
// the device management of the falcon.
class vrpn_NovintFalcon_Device;
// Forward declaration for proxy class that maintains
// the list of objects that contribute to the force.
class vrpn_NovintFalcon_ForceObjects;
class VRPN_API vrpn_Tracker_NovintFalcon
: public vrpn_Tracker, public vrpn_Button_Filter, public vrpn_ForceDevice {
public:
/// custom constructor
vrpn_Tracker_NovintFalcon(const char *name,
vrpn_Connection *c = NULL,
const int devidx = 0,
const char *grip = NULL,
const char *kine = NULL,
const char *damp = NULL);
/// destructor
~vrpn_Tracker_NovintFalcon();
/// Called once through each main loop iteration to handle updates.
virtual void mainloop();
protected: // methods for tracker and button functionality
virtual void reset();
virtual int get_report(void);
virtual void send_report(void);
virtual void clear_values(void);
protected: // methods for force feedback functionality
/// apply forces from known objects
virtual void handle_forces(void);
public:
/// apply received information about force field effects.
virtual int update_forcefield_effect(vrpn_HANDLERPARAM p);
protected:
int m_devflags; //< device configuration flags
vrpn_float64 m_update_rate; //< update rate of device
vrpn_float64 m_damp; //< damping factor for force updates
struct timeval m_timestamp; //< last update of device status
vrpn_NovintFalcon_Device *m_dev; //< device handle
vrpn_NovintFalcon_ForceObjects *m_obj; //< handle to force generating objects
};
#endif /* defined(VRPN_USE_LIBNIFALCON) */
#endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/ianaxe/vrpn.git
git@gitee.com:ianaxe/vrpn.git
ianaxe
vrpn
vrpn
master

搜索帮助