[openrtm-users 02839] How the data ports share data with service ports?

1 post / 0 new
Amigoshan
Offline
Last seen: 9 years 6 months ago
Joined: 2011-12-01 14:18
[openrtm-users 02839] How the data ports share data with service ports?

Dear all: I’m writing a component that containing both data port and
service port. Actually it is a camera for robot tracking. And the data port
is used for outputing the location of the robot. While the service port
provides an interface for querying whether the robot is insight or not. I
program this with C++ language. In the onExecute() function, I do the vision
processing and have a variable storing whether the robot is insight or not.
The problem is, in the getStateSVC_impl.cpp where the code for the service
port is implemented, I don’t want to do the vision processing again. I
would rather use the result from onExecute() function, which is real-time
enough. But I can not get the variable in onExecute() function because I can
not have an object of it. Since the framework of getStateSVC_impl.cpp is
automatically generated by the RTBuilder, I’m not sure if the constructor
function can be added with extra parameters, which allow me to pass some
object into this class. My compromising way to solve this is to use static
variable. But as the functionality of the service port gets more complicated,
more and more static variables are needed, and even static functions are
needed. Please help me if there are any better solution. Thank you very much!
Wenshan

_______________________________________________
openrtm-users mailing list
openrtm-users@openrtm.org
http://www.openrtm.org/mailman/listinfo/openrtm-users

Undefined

Download

latest Releases : 2.0.0-RELESE

2.0.0-RELESE Download page

Number of Projects

Choreonoid

Motion editor/Dynamics simulator

OpenHRP3

Dynamics simulator

OpenRTP

Integrated Development Platform

AIST RTC collection

RT-Components collection by AIST

TORK

Tokyo Opensource Robotics Association

DAQ-Middleware

Middleware for DAQ (Data Aquisition) by KEK