[Rock-dev] Access port type name of a service port

Christian Rauch Christian.Rauch at dfki.de
Wed Aug 14 12:42:45 CEST 2013


Hi,

I have a composition that is accessing two ports, one by the concrete 
orocos task and one by giving the port of a service that is provided:

{{{
class GyroMonitor < Monitor
	add Base::CalibratedIMUSensorsSrv, :as => 'gyro_base'
	add PredictorSrv, :as => 'gyro_prediction'
	
	on(:start) do |ev|
	dynamic_connect(gyro_base_child.orocos_task.calibrated_sensors, [...])
	dynamic_connect(gyro_prediction_child.prediction_port, [...])
	end

end
}}}

where the second service is:
{{{
data_service_type 'PredictorSrv' do
	output_port 'prediction', '/base/VectorXd'
end
}}}

the method "dynamic_connect" then needs to get the type of port:
{{{
def dynamic_connect(port, name, index, options)
	port_type = port.orocos_type_name
	[...]
end
}}}

In the method "dynamic_connect" I want to get the type of the port on 
both cases: when port is a port given by the task, and when port is a 
port given by a service.
'orocos_type_name' just works for the concrete task, whereas 'type.name' 
also works with the service but gives me the wrapper type: 
"/wrappers/VectorX</double>" when I expect '/base/VectorXd'.

How do I get the type name '/base/VectorXd' from the port 'prediction'? 
(type_to_vector seems just to work with "/base/VectorXd" and not with 
"/wrappers/VectorX</double>" as is the same case with 
"/base/samples/IMUSensors_m" and "/base/samples/IMUSensors")

Regards,
Christian


-- 
  Christian Rauch
  Space Robotics

  Universität Bremen
  FB 3 - Mathematik und Informatik
  AG Robotik
  Robert-Hooke-Straße 5
  28359 Bremen, Germany

  Tel:     +49 (0)421 178 45-6619
  Empfang: +49 (0)421 178 45-6611
  Fax:     +49 (0)421 178 45-4150
  E-Mail:  Christian.Rauch at dfki.de

  Weitere Informationen: http://www.informatik.uni-bremen.de/robotik



More information about the Rock-dev mailing list