Compatible method and system for multiple optical positioners

文档序号:1886963 发布日期:2021-11-26 浏览:25次 中文

阅读说明:本技术 一种多种光学定位器兼容方法及系统 (Compatible method and system for multiple optical positioners ) 是由 王少白 周武建 于 2021-07-20 设计创作,主要内容包括:本发明公开了一种多种光学定位器兼容方法及系统,方法包括:S1:业务层对外提供定位器接口,接收光学定位设备的业务代理请求,并根据业务代理请求选择创建定位器设备抽象基类的具体设备子类,以实现相应的业务逻辑;S2:通信层根据定位器设备抽象基类的具体设备子类,获取定位器的设备信息,根据设备信息中的通信连接信息选择创建定位器通信抽象基类的具体通信子类,以实现与光学定位器实体的工作通信。本发明基于业务层将各种光学定位器封装成一个统一的定位器接口,向上提供统一的调用,并且基于业务层和通信层将将各种光学定位器抽象成基类,向下兼容各种同类型设备,不仅兼容各种光学定位器设备,而且实现自由切换光学定位器设备。(The invention discloses a method and a system for compatibility of various optical positioners, wherein the method comprises the following steps: s1: the service layer provides a locator interface for the outside, receives a service agent request of the optical positioning equipment, and selects and creates a concrete equipment subclass of an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic; s2: the communication layer acquires the equipment information of the locator according to the concrete equipment subclass of the locator equipment abstract base class, and selects and creates the concrete communication subclass of the locator communication abstract base class according to the communication connection information in the equipment information so as to realize the working communication with the optical locator entity. The invention encapsulates various optical positioners into a uniform positioner interface based on the service layer, provides uniform calling upwards, abstracts various optical positioners into base types based on the service layer and the communication layer, is compatible with various devices of the same type downwards, is compatible with various optical positioner devices and realizes free switching of the optical positioner devices.)

1. A method for compatibility of a plurality of optical positioners, comprising the steps of:

s1: the service layer provides a locator interface for the outside, receives a service agent request of the optical positioning equipment, and selects a concrete equipment subclass for creating an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic;

s2: the communication layer acquires equipment information of the locator according to the concrete equipment subclass of the locator equipment abstract base class, and selects and creates a concrete communication subclass of the locator communication abstract base class according to communication connection information in the equipment information so as to realize working communication with an optical locator entity;

the specific device subclass is service logic for realizing a specific optical locator, and the specific communication subclass is communication logic for realizing a specific optical locator.

2. The method according to claim 1, wherein the locator device abstraction base class is aggregated with optical data classes, and wherein in step S1, the optical data classes are obtained through the concrete device subclasses of the locator device abstraction base class to complete corresponding business logic.

3. The multiple optical locator compatible method of claim 2 wherein the optical data classes include identification, name, pose, accuracy and status information of the optical locator.

4. The method according to any of claims 1 to 3, wherein in step S1, the selecting a concrete device subclass that creates a locator device abstraction base class according to the service agent request further comprises:

if the service agent request is a service request for an optical locator based on TCP communication, the specific equipment subclass is a TCPTtracker subclass;

if the service agent request is a service request for an optical locator based on serial port communication, the specific equipment subclass is a SerialPortTracker subclass;

if the service agent request is a service request for an extended optical locator, the specific equipment subclass is a locator extended subclass;

the TCPTtracker subclass is service logic of an optical locator based on TCP communication, the SerialPortTracker subclass is service logic of an optical locator based on serial port communication, and the locator extension subclass is service logic of an extended optical locator supporting configuration.

5. The method as claimed in any one of claims 1 to 3, wherein the specific communication subclass includes a TCP communication subclass, a serial communication subclass, and an extended communication subclass, and the step S3 selecting the specific communication subclass for creating the locator communication abstraction base class according to the communication connection information in the device information further includes:

if the device communication mode corresponding to the device information is TCP communication, the specific communication subclass is the TCP communication subclass;

if the device communication mode corresponding to the device information is serial communication, the specific communication subclass is the serial communication subclass;

if the device communication mode corresponding to the device information is extended communication, the specific communication subclass is the extended communication subclass;

the TCP communication subclass is communication logic of TCP communication, the serial communication subclass is communication logic of serial communication, and the extended communication subclass is communication logic supporting configured extended communication.

6. The multi-optical-locator-compatible method of claim 5, wherein the device information comprises a device type, a name, and a connection status.

7. A multiple optical positioner compatibility system comprising, in order from top to bottom of the system: the locator communication system comprises a locator interface, a service layer of a locator equipment abstract base class and a communication layer of a locator communication abstract base class;

the service layer is used for providing a locator interface for the outside, receiving a service agent request of the optical positioning equipment, and selecting a concrete equipment subclass for creating an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic;

the communication layer is used for acquiring equipment information of the locator according to the specific equipment subclass of the locator equipment abstract base class, and selecting and establishing the specific communication subclass of the locator communication abstract base class according to communication connection information in the equipment information so as to realize working communication with an optical locator entity;

the specific device subclass is service logic for realizing a specific optical locator, and the specific communication subclass is communication logic for realizing a specific optical locator.

8. The multiple optical locator compatible system of claim 7 wherein the locator device abstraction base class is aggregated with optical data classes, wherein the business layer is configured to obtain the optical data classes through the concrete device subclass of the locator device abstraction base class to complete corresponding business logic.

9. The multiple optical locator-compatible system of claim 8 wherein the optical data class comprises identification, name, pose, accuracy and status information of the optical locator.

10. The multiple optical locator-compatible system of claim 7 wherein the device information is coupled to the service layer as a master node of the communication layer.

11. The multiple optical locator-compatible system of any one of claims 7 to 10, wherein the specific device subclass comprises a locator general subclass and a locator extension subclass, and the specific communication subclass comprises a communication general subclass and a communication extension subclass, wherein the locator general subclass comprises a TCP communication subclass and a serial port tracker subclass, and the communication general subclass comprises a TCP communication subclass and a serial port communication subclass, and the locator extension subclass and the communication extension subclass are used for extending compatible optical locators of the same class.

12. The multiple optical locator-compatible system of any one of claims 7 to 10 wherein the locator interface is provided with a plurality of proxy interfaces including an initialization interface, a connection interface, a tracking interface, a tag body interface, and a device information interface.

13. The multiple optical locator-compatible system of claim 12 wherein the locator device abstraction base class is configured with service interfaces corresponding to a plurality of the proxy interfaces, wherein the proxy interfaces are configured to proxy the service interfaces to perform corresponding service functions.

14. The multiple optical locator-compatible system of claim 13, wherein the device information comprises a device type, a name, and a connection status, and wherein the locator communication abstraction base class is configured with a communication connection interface and a data collection interface.

15. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the plurality of optical positioner compatibility methods of any of claims 1 to 6.

16. A storage medium having stored thereon computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the plurality of optical locator compatible methods of any of claims 1-6.

Technical Field

The invention belongs to the technical field of optical positioner structures, and particularly relates to a method and a system for compatibility of various optical positioners.

Background

At present, a plurality of devices based on passive or active infrared optical positioning or visible light positioning exist in the market, and the cameras are widely applied to the application fields of medical operation positioning navigation, movie and television game motion capture, scientific research and the like which need millisecond-level and even submillimeter-level accurate positioning.

The cameras comprise the following general components: the infrared or RGB camera with single or multiple eyes and the positioning marker such as infrared illuminant, the infrared reflection solving and the black and white grid image; the communication mode with the application side adopts the mode based on serial port, network (TCP/UDP) and the like, and the physical/network topological diagram is shown in figure 1.

The current common lenses in the industry include, in network TCP communication: NDI Vega, which communicates by serial ports: NDI Spectra, directly providing SDK, are: OptiTrack, cyan pupil, etc., and some self-developed positioning lenses, basically all communicate with the upper computer in the above three ways. Because the products have different communication protocols, control time sequences, communication data formats and the like, the upper computer developers do a large amount of repeated development work for coping with different optical positioners under the condition of the same requirement.

Therefore, in order to accommodate a variety of optical positioners such that the upper business logic is not concerned with the specific optical positioner hardware devices, a variety of optical positioner compatibility techniques are required.

Disclosure of Invention

The present invention provides a method and a system for compatibility of various optical positioners, which aims to solve the technical problems.

In order to solve the problems, the technical scheme of the invention is as follows:

a multiple optical positioner compatibility method comprising the steps of:

s1: the service layer provides a locator interface for the outside, receives a service agent request of the optical positioning equipment, and selects and creates a concrete equipment subclass of an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic;

s2: the communication layer acquires equipment information of the locator according to the concrete equipment subclass of the locator equipment abstract base class, and selects and creates the concrete communication subclass of the locator communication abstract base class according to communication connection information in the equipment information so as to realize working communication with the optical locator entity;

the specific device subclass is service logic for realizing the specific optical positioner, and the specific communication subclass is communication logic for realizing the specific optical positioner.

In one embodiment, the optical data class is aggregated in the locator device abstraction base class, wherein in step S1, the optical data class is obtained through the concrete device subclass of the locator device abstraction base class to complete the corresponding business logic.

In one embodiment, the optical data class includes identification, name, pose, accuracy, and status information of the optical locator.

In one embodiment, in step S1, selecting the concrete device subclass for creating the locator device abstraction base class according to the service agent request further includes:

if the service agent request is a service request for an optical locator based on TCP communication, the specific equipment subclass is a TCPTtracker subclass;

if the service agent request is a service request for an optical locator based on serial port communication, the specific equipment subclass is a SerialPortTracker subclass;

if the service agent request is a service request for expanding the optical positioner, the specific equipment subclass is a positioner expanding subclass;

the TCPTtracker subclass is service logic of an optical locator based on TCP communication, the SerialPortTracker subclass is service logic of an optical locator based on serial port communication, and the locator extension subclass is service logic of an extended optical locator supporting configuration.

In one embodiment, the concrete communication subclass includes a TCP communication subclass, a serial communication subclass, and an extended communication subclass, and in step S3, selecting the concrete communication subclass that creates the locator communication abstraction base class according to the communication connection information in the device information further includes:

if the device communication mode corresponding to the device information is TCP communication, the specific communication subclass is a TCP communication subclass;

if the device communication mode corresponding to the device information is serial communication, the specific communication subclass is a serial communication subclass;

if the device communication mode corresponding to the device information is extended communication, the specific communication subclass is an extended communication subclass;

the TCP communication subclass is communication logic of TCP communication, the serial communication subclass is communication logic of serial communication, and the extended communication subclass is communication logic supporting configured extended communication.

In one embodiment, the device information includes a device type, a name, and a connection status.

A multiple optical positioner compatible system comprising, in order from top to bottom of the system: the locator communication system comprises a locator interface, a service layer of a locator equipment abstract base class and a communication layer of a locator communication abstract base class;

the service layer is used for providing a locator interface to the outside, receiving a service agent request of the optical positioning equipment, and selecting and creating a concrete equipment subclass of an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic;

the communication layer is used for acquiring equipment information of the locator according to the concrete equipment subclass of the locator equipment abstract base class, and selecting and establishing the concrete communication subclass of the locator communication abstract base class according to the communication connection information in the equipment information so as to realize the working communication with the optical locator entity;

the specific device subclass is service logic for realizing the specific optical positioner, and the specific communication subclass is communication logic for realizing the specific optical positioner.

In one embodiment, the locator device abstraction base class is aggregated with optical data classes, wherein the business layer is configured to obtain the optical data classes through a concrete device subclass of the locator device abstraction base class to complete corresponding business logic.

In one embodiment, the optical data class includes identification, name, pose, accuracy, and status information of the optical locator.

10. The multiple optical locator compatible system of claim 7 wherein the device information is connected to the service layer as a master node of the communication layer.

In one embodiment, the specific device subclass includes a locator common subclass and a locator extension subclass, and the specific communication subclass includes a communication common subclass and a communication extension subclass, where the locator common subclass includes a tcptrake subclass and a SerialPortTracker subclass, the communication common subclass includes a TCP communication subclass and a serial communication subclass, and the locator extension subclass and the communication extension subclass are used to extend compatible optical locators of the same class.

In one embodiment, the locator interface is provided with a plurality of agent interfaces, and the agent interfaces comprise an initialization interface, a connection interface, a tracking interface, a marker body interface and an equipment information interface.

In one embodiment, the locator device abstraction base class is provided with service interfaces corresponding to a plurality of proxy interfaces, wherein the proxy interfaces are used for acting on the service interfaces to complete corresponding service functions.

In one embodiment, the device information includes a device type, a name, and a connection status, and the locator communication abstraction base class is provided with a communication connection interface and a data collection interface.

A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the various optical locator-compatible methods described above.

A storage medium having stored thereon computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the various optical locator-compatible methods described above.

Compared with the prior art, the invention has the following advantages and positive effects:

the invention encapsulates various optical positioners into a uniform positioner interface based on a service layer, provides uniform call upwards, and abstracts the communication, control and state of various optical positioners into a base class based on the service layer and a communication layer, wherein a concrete equipment subclass of an abstract base class of positioner equipment is created by the positioner interface to complete corresponding service logic, the concrete communication subclass of the abstract base class of positioner communication is initialized by equipment information, and the equipment information is obtained from the concrete equipment subclass of the abstract base class of positioner equipment to realize downward compatibility with various equipment of the same type.

Drawings

Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention.

FIG. 1 is a diagram of a prior art physical/network topology of an optical locator;

FIG. 2 is a general flow chart of a multi-optical positioner compatibility method of the present invention;

FIG. 3 is an overall architecture diagram of a multiple optical positioner compatibility system of the present invention;

FIG. 4 is a diagram of a fixture interface configuration for a multiple optical fixture compatibility system of the present invention;

FIG. 5 is a business layer block diagram of a multiple optical locator compatible system of the present invention;

FIG. 6 is a diagram of the communication layer structure of a multiple optical positioner compatibility system of the present invention;

FIG. 7 is a block diagram of an optical data class for a multiple optical positioner compatibility system in accordance with the present invention;

FIG. 8 is a diagram of the device information structure of a multiple optical positioner compatibility system of the present invention.

Detailed Description

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.

For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".

The following describes in detail a multi-optical positioner compatible method and system according to the present invention with reference to the accompanying drawings and embodiments.

First embodiment

Referring to FIG. 2, the present application provides a multiple optical positioner compatibility method comprising the steps of:

s1: the service layer provides a locator interface for the outside, receives a service agent request of the optical positioning equipment, and selects and creates a concrete equipment subclass of an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic;

s2: the communication layer acquires equipment information of the locator according to the concrete equipment subclass of the locator equipment abstract base class, and selects and creates the concrete communication subclass of the locator communication abstract base class according to communication connection information in the equipment information so as to realize working communication with the optical locator entity;

the specific device subclass is service logic for realizing the specific optical positioner, and the specific communication subclass is communication logic for realizing the specific optical positioner.

The present embodiment will now be described in detail, but is not limited thereto.

The embodiment is suitable for any optical positioner in the market, and realizes the functions of communication, control, state monitoring and the like with various optical positioners, wherein the embodiment fully considers various basic design principles facing to objects, and follows the principles of single responsibility, interface isolation, composite reuse and the like by using methods of generalization, aggregation, dependence inversion and the like, thereby achieving the architectural purpose of low coupling and high expansion.

1) Detailed description of step S1

The service layer of this embodiment provides a locator interface to the outside, receives a service proxy request of the optical positioning device, and selects a specific device subclass that creates an abstract base class of the locator device according to the service proxy request, so as to implement a corresponding service logic. Specifically, the service layer of this embodiment provides a locator interface tracker sdk facing the user object Client to the outside, and is responsible for providing an open interface and a top layer as a policy for the user object Client, and service logic of a specific optical locator is aggregated, where a locator device abstraction base class AbstractTracker provides a specific implementation of a device policy for the locator interface tracker sdk, and mainly generalizes various specific device subclasses, the service layer of this embodiment uses the locator interface tracker sdk as a policy layer selected by a specific optical locator, and selects a specific device subclass for creating the locator device abstraction base class AbstractTracker according to a service agent request received by the locator interface tracker sdk, the specific device subclass is service logic for implementing a specific optical locator, the specific device subclass includes a locator subclass and a locator extension subclass, and the locator subclass includes a specific device tcpttracker subclass corresponding to the optical locator for example, TCP communication, the method includes the steps that specific equipment subclasses SerialPortTracker and the like corresponding to optical positioners in serial port communication are obtained, different optical positioners correspond to different specific equipment subclasses, and specific subclasses of AbstractTracker of a positioner equipment abstraction base class are selected and established according to business requirements.

Further, in step S1, selecting the concrete device subclass for creating the locator device abstraction base class according to the service agent request further includes: if the service agent request is a service request for an optical locator based on TCP communication, the specific equipment subclass is a TCPTtracker subclass; if the service agent request is a service request for an optical locator based on serial port communication, the specific equipment subclass is a SerialPortTracker subclass; if the service agent request is a service request for expanding the optical positioner, the specific equipment subclass is a positioner expanding subclass; the tcptrake subclass is service logic of an optical locator based on TCP communication, the SerialPortTracker subclass is service logic of an optical locator based on serial port communication, and the locator extended subclass is service logic of an extended optical locator supporting configuration, and specifically, the locator extended subclass can be obtained by adaptively adjusting according to service logic of the tcptrake subclass, the SerialPortTracker subclass, and the like, so as to realize convenient extension.

2) Detailed description of step S2

The communication layer of this embodiment obtains the device information of the locator according to the specific device subclass of the locator device abstraction base class, and selects and creates the specific communication subclass of the locator device communication abstraction base class according to the communication connection information in the device information to implement working communication with the optical locator entity. Specifically, the communication layer is provided with a locator communication abstraction base abstracted connection for defining logic for communicating with a specific optical locator, wherein the communication layer of the embodiment uses device information DeviceInfo as a master node of a communication layer policy, the device information DeviceInfo provides device basic information and a communication connection policy, the device information DeviceInfo is obtained by a specific device subclass of a locator device abstraction base abstracted tracker selected in a service layer, a specific communication subclass of the locator communication abstraction base abstracted connection is selected and created based on the device information DeviceInfo to complete communication with the specific optical locator, the specific communication subclass includes a communication common subclass and a communication extension subclass, the communication common subclass, for example, a TCP communication subclass TCPConnection is generalized based on TCP communication, a serial port communication subclass communication is generalized based on serial port communication, and in order to expand communication compatible with other similar optical locators, the embodiment is further provided with a communication extension subclass, based on the abstract base class OtherSDKConnection provided by the existing manufacturer for packaging the SDK, the communication expansion subclass OptiTrackSDKConnection can be configured and generalized in combination with the actual situation OtherSDKConnection, the communication compatibility of the same type of localizers can be realized, the expansion of the same type of optical localizers is realized, and the compatibility of the embodiment is greatly improved.

Further, the concrete communication subclass of this embodiment includes a TCP communication subclass, a serial communication subclass, and an extended communication subclass, and in step S3, selecting the concrete communication subclass for creating the locator communication abstraction base class according to the communication connection information in the device information further includes: if the device communication mode corresponding to the device information is TCP communication, the specific communication subclass is a TCP communication subclass; if the device communication mode corresponding to the device information is serial communication, the specific communication subclass is a serial communication subclass; if the device communication mode corresponding to the device information is extended communication, the specific communication subclass is an extended communication subclass; the TCP communication subclass is a communication logic of TCP communication, the serial communication subclass is a communication logic of serial communication, and the extended communication subclass is a communication logic of extended communication supporting configuration, and specifically, the extended communication subclass can be obtained by adaptive adjustment according to the communication logic of the TCP communication subclass, the serial communication subclass, and the like, so that convenient extension is realized.

In this embodiment, an abstract socket of the locator device in the service layer aggregates an optical data type ToolData, and provides a data record for an optical marker of the optical locator, where the data record includes records of an identifier, a name, a pose, accuracy, state information, and the like of the optical locator, and specifically, the optical data type is obtained through the abstract socket of the locator device, and a specific device subclass completes a corresponding service logic.

The embodiment is mainly realized on the basis of a policy mode as a whole, the policy of the embodiment is divided into an upper layer and a lower layer, namely a service layer and a communication layer, wherein the upper layer service layer policy is based on a Tracker SDK class, different AbstractactTracker class specific implementation subclasses are selected according to actual physical equipment to complete corresponding service processing, the lower layer communication layer policy is based on DeviceInfo and is realized according to the specific Tracker selected by the upper layer, the DeviceInfo requires the corresponding implementation subclass of Abstractconnection to complete communication service with the equipment, and in addition, ToolData is aggregated into the AbstractTracker to provide information such as the pose of an optical marker tool.

In this embodiment, various optical positioners are encapsulated into a uniform positioner interface based on a service layer, unified calls are provided upwards, and communication, control and status of various optical positioners are abstracted into a base class based on the service layer and a communication layer, wherein a specific device subclass of the locator device abstraction base class is created by the positioner interface to complete corresponding service logic, the specific communication subclass of the locator communication abstraction base class is initialized by device information, and the device information is obtained from the specific device subclass of the locator device abstraction base class, so that downward compatibility with various devices of the same type is achieved.

Second embodiment

Referring to FIG. 3, the present application provides a first embodiment of a multiple optical positioner compatible system comprising, in order from top to bottom: the locator communication system comprises a locator interface, a service layer of a locator equipment abstract base class and a communication layer of a locator communication abstract base class;

the service layer is used for providing a locator interface to the outside, receiving a service agent request of the optical positioning equipment, and selecting and creating a concrete equipment subclass of an abstract base class of the locator equipment according to the service agent request so as to realize corresponding service logic;

the communication layer is used for acquiring equipment information of the locator according to the concrete equipment subclass of the locator equipment abstract base class, and selecting and establishing the concrete communication subclass of the locator communication abstract base class according to the communication connection information in the equipment information so as to realize the working communication with the optical locator entity;

the specific device subclass is service logic for realizing the specific optical positioner, and the specific communication subclass is communication logic for realizing the specific optical positioner.

The present embodiment will now be described in detail, but is not limited thereto.

The embodiment is suitable for any optical positioner in the market, and realizes the functions of communication, control, state monitoring and the like with various optical positioners, wherein the embodiment fully considers various basic design principles facing to objects, and follows the principles of single responsibility, interface isolation, composite reuse and the like by using methods of generalization, aggregation, dependence inversion and the like, thereby achieving the architectural purpose of low coupling and high expansion.

1) Concrete introduction business layer

Referring to fig. 4 and 5, the service layer of this embodiment provides a locator interface to the outside, receives a service proxy request of the optical positioning device, and selects a specific device subclass for creating the abstract base class of the locator device according to the service proxy request, so as to implement a corresponding service logic. Specifically, the service layer of this embodiment provides a locator interface tracker sdk facing the user object Client to the outside, and is responsible for providing an open interface and a top layer as a policy for the user object Client, and service logic of a specific optical locator is aggregated, where the locator device abstraction base class AbstractTracker provides a specific implementation of a device policy for the locator interface tracker sdk, and mainly generalizes various specific device subclasses, the service layer of this embodiment uses the locator interface tracker sdk as a policy layer selected by a specific optical locator, and selects a specific device subclass for creating the locator device abstraction base class AbstractTracker according to a service agent request received by the locator interface tracker sdk, where the specific device subclass includes a locator subclass and a locator extension subclass, the locator subclass is, for example, a specific device TCP packet corresponding to an optical locator for communication, a specific device serial packet corresponding to an optical locator for communication, and so on, different optical positioners correspond to different concrete equipment subclasses, and concrete subclasses of an abstract class AbstractTracker of the positioner equipment abstract class are selected and created according to service requirements.

Further, the locator interface tracker sdk of this embodiment is provided with a plurality of proxy interfaces, and the proxy interfaces include an initialization interface, a connection interface, a tracking interface, a tag body interface, and an equipment information interface. Specifically, referring to fig. 4, the proxy interfaces of the present embodiment specifically include: the method comprises the steps of initializing an initialization interface Init of an optical positioner, establishing a connection interface Connect, disconnecting a connection interface Disconnect, starting a tracking interface startracking to start tracking, stopping the tracking interface StopTracking, loading a mark body interface LoadTool of an optical mark body, unloading a mark body interface UnloadTool of the optical mark body, obtaining mark body interfaces Gettools of all the optical mark bodies, and obtaining equipment information interface GetDeviceInfo. Wherein the proxy interfaces are used to proxy various behaviors of the locator device abstraction base class.

Further, the abstracted base class abstract tracker of the locator device in this embodiment is provided with service interfaces corresponding to a plurality of proxy interfaces, where a proxy interface is used for proxying a service interface to complete a corresponding service function. Specifically, referring to fig. 5, a plurality of service interfaces of the present embodiment correspond to and are consistent with each interface in a plurality of proxy interfaces one to one, and are used for receiving a proxy of a proxy interface and specifically implementing a service behavior of an optical locator, where the locator device abstraction base class abstract tracker is further provided with an updateTools interface for updating real-time data of all tools and an updateDevice interface for updating device information.

2) Detailed description of the communication layer

Referring to fig. 6 and fig. 7, the communication layer of this embodiment obtains the device information of the locator according to the concrete device subclass of the locator device abstraction base class, and selects and creates the concrete communication subclass of the locator communication abstraction base class according to the communication connection information in the device information, so as to implement working communication with the optical locator entity. Specifically, the communication layer is provided with a locator communication abstraction class abstract connection for defining logic for communicating with a specific optical locator, wherein the communication layer of the embodiment uses device information DeviceInfo as a master node of a communication layer policy, the device information DeviceInfo provides device basic information and a communication connection policy, the device information DeviceInfo is obtained from a specific device subclass of a locator device abstraction class abstract connector selected in the service layer, a specific communication subclass of the locator communication abstraction class abstract connection is selected and created based on the device information DeviceInfo to complete communication with the specific optical locator, the specific communication subclass includes a communication common subclass and a communication extension subclass, the communication common subclass includes, for example, a TCP communication subclass TCPConnection based on TCP communication generalization, a serial communication generic serial communication port connection based on serial communication subclass generalization, and in order to extend communication compatible with other optical locators of the same kind, based on the abstract base class OtherSDKConnection provided by the existing manufacturer for packaging the SDK, the communication expansion subclass OptiTrackSDKConnection can be configured and generalized in combination with the actual situation OtherSDKConnection, the communication compatibility of the same type of localizers can be realized, the expansion of the same type of optical localizers is realized, and the compatibility of the embodiment is greatly improved.

The device information of this embodiment includes a device type, a name, and a connection state, and the locator communication abstraction base class is provided with a communication connection interface and a data acquisition interface. Specifically, referring to fig. 6, the device information DeviceInfo specifically includes connected indicating whether to Connect, type indicating a device type, name indicating a device name, and SetConnection interface setting a connection instance, getconnection returning a specific connection instance currently used, m _ connection of a specific connection instance currently used, and referring to fig. 7, the locator communication abstraction base class abstract connection specifically includes communication connection interface Connect establishing connection, communication connection interface Disconnect disconnecting, onData collecting data of a device.

Referring to fig. 8, the abstracted tracker class of the locator device in the service layer of this embodiment aggregates an optical data class ToolData, and provides a data record for an optical marker of the optical locator, where the data record includes records of identification, name, pose, precision, state information, and the like of the optical locator, and specifically, the optical data class is obtained through the abstracted locator device class, and a specific device subclass completes a corresponding service logic. Specifically, referring to fig. 8, the optical data ToolData of the present embodiment specifically includes: optical marker unique identifier id, optical marker name, position coordinates x, y, z, rotation amount four elements q0, q1, q2, q3, precision value rms, whether tracked active.

The embodiment is mainly realized on the basis of a policy mode as a whole, the policy of the embodiment is divided into an upper layer and a lower layer, namely a service layer and a communication layer, wherein the upper layer service layer policy is based on a Tracker SDK class, different AbstractactTracker class specific implementation subclasses are selected according to actual physical equipment to complete corresponding service processing, the lower layer communication layer policy is based on DeviceInfo and is realized according to the specific Tracker selected by the upper layer, the DeviceInfo requires the corresponding implementation subclass of Abstractconnection to complete communication service with the equipment, and in addition, ToolData is aggregated into the AbstractTracker to provide information such as the pose of an optical marker tool.

In this embodiment, various optical positioners are encapsulated into a uniform positioner interface based on a service layer, unified calls are provided upwards, and communication, control and status of various optical positioners are abstracted into a base class based on the service layer and a communication layer, wherein a specific device subclass of the locator device abstraction base class is created by the positioner interface to complete corresponding service logic, the specific communication subclass of the locator communication abstraction base class is initialized by device information, and the device information is obtained from the specific device subclass of the locator device abstraction base class, so that downward compatibility with various devices of the same type is achieved.

Third embodiment

The invention also proposes a computer device comprising a memory and a processor, said memory having stored therein computer-readable instructions which, when executed by said processor, cause said processor to carry out a plurality of optical locator compatible methods as mentioned above in relation to the first embodiment.

Fourth embodiment

The present invention proposes a storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform a plurality of optical positioner compatibility methods as mentioned in the first embodiment above.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express some exemplary embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于摄影测量坐标定位的标识系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!