Re: Remoting and Robotics
- From: "Greg Young" <druckdruckREMOVEgoose@xxxxxxxxxxx>
- Date: Fri, 7 Jul 2006 16:57:09 -0400
I disagree with the others here .. I think a connection based protocol will
not work well for you.
I think you should look at implementing a simple UDP based protocol that
doesn't mind packet loss. With a connection based protocol you will often
have your controls go completely dead if it hits an off spot or sits on the
edge of its connection. A UDP based protocol is very simple to create
(especially just to tell it to do actions). More importantly if it hits a
bad spot it might miss a packet or two but it will keep on trucking.
http://msdn.microsoft.com/msdnmag/issues/06/02/UDP/ is worth a read.
Here is some simple client/sending code but it is literally about 15 lines
of code (the receiver being most of it .. the sending side is pretty much
UdpCLient.Send()
using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
class Receiver {
static void Main(string[] args) {
UdpClient client = new UdpClient(1111);
IPEndPoint point = null;
while(true) {
byte[] data = client.Receive(ref point);
if (data.Length > 0) {
Console.WriteLine("Received " + data.Length + " bytes
from " + point.Address);
Console.WriteLine ("\t" +
Encoding.ASCII.GetString(data));
}
}
}
}
Cheers,
Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
"Padu" <padu@xxxxxxxxxxxx> wrote in message
news:yZ6dnQGJ_7OAOjPZnZ2dnUVZ_vidnZ2d@xxxxxxxxxxxxx
Hi,
I'm developing a remote control panel for a mobile robot I'm developing.
The robot carries a PC that runs a C# app to control the platform. The
robot's PC has a wi-fi card. I'm not concerned with range issues now.
Now I want to create an application that will reside on my laptop that
will send commands to the robot (go forward, brake, pan, tilt, get me a
gps fix, etc) and will receive information messages (gps fix, a bitmap
image, sensor reading, etc).
I'm new to .net development, so I was about to start using direct TCP/IP
sockets when someone told me that remoting would be much easier. I'm
studying it right now.
Now I come here to ask you about what options would be best in this
environment. Keeping in mind the following considerations:
- Access rights and network safety is of no concern
- Performance is a mild concern
- Scalability is of no concern
Also make the other usual assumptions of a robotic environment vs. a
business environment.
Cheers
Padu
.
- References:
- Remoting and Robotics
- From: Padu
- Remoting and Robotics
- Prev by Date: Re: Image upload
- Next by Date: New to C# :
- Previous by thread: Re: Remoting and Robotics
- Next by thread: Re: Remoting and Robotics
- Index(es):
Relevant Pages
|