Subscribe to IRseeker problem

Jun 20, 2010 at 11:23 PM

 

 

[

 

Partner("NxtIRSensor", Contract = irsensor.Contract.Identifier, CreationPolicy = PartnerCreationPolicy.UseExisting)]

irsensor.

 

IRSeekerV2Operations _nxtIRSensorPort = new irsensor.IRSeekerV2Operations();

irsensor.

 

IRSeekerV2Operations _nxtIRSensorNotify = new irsensor.IRSeekerV2Operations();

irsensor.

 

 

 

 

 

 

 

 

 

 

 

 

irsensor.

 

IRSeekerV2Operations irSensorNotificationPort = new irsensor.IRSeekerV2Operations

();

 

 

//_nxtIRSensorPort.Subscribe(irSensorNotificationPort);

 

 

Activate(

 

Arbiter.Receive<irsensor.IRSeekerV2Update>(true

 

, irSensorNotificationPort (problem is here), IRUpdated));

 

 

 

 

private void IRUpdated(irsensor.IRSeekerV2Update notification)

{  

Console.WriteLine("Yeehaww");

}

 

 

 

 

 

 

 

 

hi
i get error with this.. there is no subscribe?
and the arbiter i get this error:

 

Error 1 The best overloaded method match for 'Microsoft.Ccr.Core.Arbiter.Receive<Microsoft.Robotics.Services.Sample.HiTechnic.IRSeekerV2.IRSeekerV2Update>(bool, Microsoft.Ccr.Core.Port<Microsoft.Robotics.Services.Sample.HiTechnic.IRSeekerV2.IRSeekerV2Update>, Microsoft.Ccr.Core.Handler<Microsoft.Robotics.Services.Sample.HiTechnic.IRSeekerV2.IRSeekerV2Update>)' has some invalid arguments C:\Users\xxx\Microsoft Robotics Dev Studio 2008 R3\xxx\xxx\xx.cs 104
 Error 2 Argument '2': cannot convert from 'Microsoft.Robotics.Services.Sample.HiTechnic.IRSeekerV2.IRSeekerV2Operations' to 'Microsoft.Ccr.Core.Port<Microsoft.Robotics.Services.Sample.HiTechnic.IRSeekerV2.IRSeekerV2Update>' C:\Users\xxx\Microsoft Robotics Dev Studio 2008 R3\xx\xxx\xx.cs 104
Coordinator
Jun 27, 2010 at 8:15 PM

I replied to the same question here:

http://social.msdn.microsoft.com/Forums/en-US/roboticstroubleshooting/thread/ddbbae65-76e2-483c-9fa3-8eb4f399bc79

Trevor

 

Coordinator
Jun 27, 2010 at 8:16 PM
I replied to the same question here:
http://social.msdn.microsoft.com/Forums/en-
US/roboticstroubleshooting/thread/ddbbae65-76e2-483c-9fa3-8eb4f399bc79

I can't see a problem with the code, although it is very hard to read.
When I created similar code it worked.

Trevor

> From: sonicred
>
> [ Partner("NxtIRSensor", Contract = irsensor.Contract.Identifier,
CreationPolicy = PartnerCreationPolicy.UseExisting)] irsensor.
IRSeekerV2Operations _nxtIRSensorPort = new irsensor.IRSeekerV2Operations
(); irsensor. IRSeekerV2Operations _nxtIRSensorNotify = new
irsensor.IRSeekerV2Operations();irsensor. irsensor.
IRSeekerV2Operations irSensorNotificationPort = new
irsensor.IRSeekerV2Operations(); //_nxtIRSensorPort.Subscribe
(irSensorNotificationPort); Activate(
Arbiter.Receive<irsensor.IRSeekerV2Update>(true , irSensorNotificationPort
(problem is here), IRUpdated)); private void IRUpdated
(irsensor.IRSeekerV2Update notification) { Console.WriteLine
("Yeehaww"); } hi
> i get error with this.. there is no subscribe?
> and the arbiter i get this error: Error 1 The best overloaded method match
for 'Microsoft.Ccr.Core.Arbiter.Receive<Microsoft.Robotics.Services.Sample.HiT
echnic.IRSeekerV2.IRSeekerV2Update>(bool,
Microsoft.Ccr.Core.Port<Microsoft.Robotics.Services.Sample.HiTechnic.IRSeeke
rV2.IRSeekerV2Update>,
Microsoft.Ccr.Core.Handler<Microsoft.Robotics.Services.Sample.HiTechnic.IRSe
ekerV2.IRSeekerV2Update>)' has some invalid arguments
C:\Users\xxx\Microsoft Robotics Dev Studio 2008 R3\xxx\xxx\xx.cs 104
> Error 2 Argument '2': cannot convert
from 'Microsoft.Robotics.Services.Sample.HiTechnic.IRSeekerV2.IRSeekerV2Op
erations'
to 'Microsoft.Ccr.Core.Port<Microsoft.Robotics.Services.Sample.HiTechnic.IRSee
kerV2.IRSeekerV2Update>' C:\Users\xxx\Microsoft Robotics Dev Studio 2008 R3
\xx\xxx\xx.cs 104
>
>
>



Trevor Taylor
Director
Software Technology, Qld, Australia
mailto:[email removed]