[Rock-dev] How to explicit assign task ports to service ports?
Sylvain Joyeux
sylvain.joyeux at dfki.de
Wed Sep 4 10:43:52 CEST 2013
On 09/04/2013 10:08 AM, Matthias Goldhoorn wrote:
> Try apply the attached patch.
>
> @other rock dev's:
> Are you fine with that patch, it will change the behavior of the
> function. In the past every given portname-string was interpreted as a
> regular expression, which causes the fault if there ports like this:
>
> a.somename
> a.somenameextension
>
> There was no way to get ony the first port out of this function.
>
> Second Problem was/is that the function tool always uses the full_name
> for comparison, that means the port names were compared with
> "task.port" and not ony "port". I added the separation by checking if
> an "." (dot) is present in the given string for the port-resolution.
I personally don't see the point of testing against the task. The
receiver *is* the task, so we should only match against the port name.
The "pattern matching" operator in Ruby is ===, so you can replace
+ if port_name.kind_of?(Regexp)
+ res = p_name !~ port_name
+ else
+ res = p_name != port_name
+ end
by
res = (port_name === p_name)
--
Sylvain Joyeux (Dr.Ing.)
Senior Researcher
Space & Security Robotics
Underwater Robotics
!!! Achtung, neue Telefonnummer!!!
Standort Bremen:
DFKI GmbH
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany
Phone: +49 (0)421 178-454136
Fax: +49 (0)421 218-454150
E-Mail: robotik at dfki.de
Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.: DE 148646973
Steuernummer: 19/673/0060/3
-----------------------------------------------------------------------
More information about the Rock-dev
mailing list