On 16-8-2017 4:38, Tengfei Shan wrote:
>> Most server implementations are done in the controller's / mfg's native
>> language, not a general purpose programming language.
>>
>> One of the few open-source server implementations in C is the one in
>> MotoROS [1].
>>
>> There will be parts that are tied to the underlying vxworks / motoplus
>> rtl, but the design document [2] should make the important parts clear
>> and answer most of your questions.
>
> Thanks for your reply!My robot controller does not have its native language
> and what it supports is general C/C++. I am sorry I don't uderstand the
> differences between the implementations used by controller's native
> language and general language like C/C++.Could you please tell me something
> about that? Is there any trouble when the server implemented by general
> language?
Take a look at languages like INFORM (Motoman), Karel (Fanuc), Val3
(Staubli) and KRL (KUKA).
You'll find that they come nowhere close to what a generic programming
language such as C can do.
And often the runtimes of those languages are limited in the kind of
support they have for network communication, so very elaborate protocols
will be hard(er) to implement than in regular C.
> Few open-source server implementation means I should transplant the code
> into my controller.Can I understand like this? Because I haven't use Moto's
> robot,so I don't know whether my robot controller support the MotoROS,or
> vxworks/motoPlus rtl you mentoined.
re: transplant: no, that is not what I meant.
I only mentioned the MotoROS code because it is one of the few
open-source examples of a ROS-Industrial / simple_message compatible
server implementation that is written in C.
So you could perhaps use it for inspiration and see how you could
approach things.
You asked about how to implement a server in C: the MotoROS code is a
server in C.
And your controller doesn't have to support MotoROS or MotoPlus
directly. The code is essentially ANSI C, so apart from some specifics
that interface with the Motoman motion controller, things like socket
and queue management, message (de)serialisation and interpolation should
be generic enough.
>> downloading implies that trajectories are bounded in size, and is
>> typically not well suited for on-line / closed-loop control, as
>> executing typically only starts after the complete trajectory has been
>> received.
>>
>> streaming supports unbounded trajectories, and is more on-line. The
>> MotoROS server implementation I linked above supports the streaming
>> approach, but the client side (ROS) implements more of a hybrid in that
>> only complete JointTrajectory messages can be streamed. See [3] for a PR
>> that adds streaming on the ROS side.
>>
>> Note that in order to limit impact of network hickups most streaming
>> drivers include a small point buffer at the server side.
>>
> Compared with downloader,streaming is a better methods.Right?But I still do
> not know How to ensure the frequency of sending data(at least 125Hz.I
> haven't read the documents you give me.Is there anything mentioned this
> problem?)
Reading those documents would help, but "ensuring the frequency of
sending data" is slightly orthogonal to implementing the server.
You'll somehow need to implement your client such that it can sustain
that rate.
As you noted in your ROS Answers question about this, the current
clients do not support pure streaming, only trajectory based streaming.
So the generic clients provided by industrial_robot_client will not be
directly usable in your case, if you decide to go with pure streaming.
>> Using simple_message is really only needed if your controller doesn't
>> support anything else. If your platform supports regular C, you might
>> want to look at other options - perhaps even some of the embedded
>> variants of ROS2 [4, 5] - which would make your controller a first-class
>> citizen of a ROS node graph and remove the need to use the intermediary
>> layer that simple_message provides.
>>
> Does the simple message should be used both on industrial_client run on PC
> and server run on robot controller if I want to use simple message? My
> platform supports regular C , so besides the variants of ROS2,is there
> anyother option? because i‘m a fresher in ROS,so I want to choice a
> relatively simple method.
No, you don't have to use the /library/ simple_message per se. You could
write all the (de)serialisation code yourself - as was done in MotoROS.
You could also reuse simple_message on your server, but keep out the ROS
parts.
simple_message is C++ though, so you'll have to make sure your
controller supports that.
Gijs