Geometry - Visualization libQGLViewer

Hi orocos-Users

does anyone has experince how to integrate qgl project with OROCOS component? I need some advice?

I hope this time to get your help!!

Geometry - Visualization libQGLViewer

On Wed, 1 Apr 2015, alaaeldeen [dot] abdalrahman [..] ... wrote:

> Hi orocos-Users
>
> does anyone has experince how to integrate qgl project with OROCOS component?
> I need some advice?

I would keep both things completely separate:
- the Orocos component for your (realtime) control functionalities;
- the GUI component for visualisation and inputs;
- both communicate through whatever communication middleware fits in your
overall system design.

This advise is just one example of the "use the right tool for the right
job. And a component-based approach is meant to decouple components
through communication anyway.

> I hope this time to get your help!!

Herman

Geometry - Visualization libQGLViewer

2015-04-07 11:16 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:

>
> [img_assist|nid=5264|title=Simulation|desc=|link=none|align=left|width=200|height=116]
>
> this is a screen shoot from my simulation, it is just represent a car and
> trajectory to follow, and according to recording data from the sensor the
> car
> will move. I will be happy if you help me to get the right naming
> convention
> such like what you said, I think in my case it will be a viewer, right?
> after
> testing I will search on some places to work on a physical model.
>
> Now I am working on two machines, one with orocos and RT Linux, and the
> other
> one generic Linux and the simulation.
>

The screen shoot didn't attached to mail, but I understand the idea. When
you say :
"trajectory to follow, and according to recording data from the sensor the
car
will move"
which part of the SW is controlling the car ? the RT computer or the
computer in simulation ?

If your car is moving in simulation you obviously have a physical model,
even if it's a simple one.

You did not answered to all questions, could you please detail those :
What is the aim of your project, what are you trying to do ?
Do you have other sensors integrated in your simulation outside some orocos
components or is it the first time you assemble everything ?

Is Orocos or any other framework already running on your simulation PC ?
are you using Qt as a framework ?

As far as I understand what you are doing I would design a Corba proxy of
your RT code on the simulation PC and a wrapper to connect this proxy into
your simulation. Basically it means a getSensor() or notifySensorValue(x)
method depending if your are doing polling or event driven design.

If your simulation tool doesn't propose any hooks to let data coming from
outside, you'd better begin with creating this interface before doing
anything else.

--
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Geometry - Visualization libQGLViewer

- Which part of the SW is controlling the car ? the RT computer or the
computer in simulation ?
- RT Computer who is responsible on all the controlling system

If your car is moving in simulation you obviously have a physical model,
even if it's a simple one.
I didn't get this part!

What is the aim of your project, what are you trying to do ?
I am trying to create a self driving system, I know it is a big system to
develop but I am working on it from three months ago. I have finished some
algorithm and develop it using C++, and now I want to use it in orocos
components.

Do you have other sensors integrated in your simulation outside some orocos
components or is it the first time you assemble everything ?
I don't know what you mean, but the simulation is just a viewer and it just
get points which will be used to move the car.

Is Orocos or any other framework already running on your simulation PC ?
No

Are you using Qt as a framework ?
No, I was trying to use it but I don't know if I need it or not, from my
point of view I don't. but my simulation developed mainly on C++, OpenGL

On Tue, Apr 7, 2015 at 8:14 PM, Willy Lambert <lambert [dot] willy [..] ...>
wrote:

>
>
> 2015-04-07 11:16 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:
>
>>
>> [img_assist|nid=5264|title=Simulation|desc=|link=none|align=left|width=200|height=116]
>>
>> this is a screen shoot from my simulation, it is just represent a car and
>> trajectory to follow, and according to recording data from the sensor the
>> car
>> will move. I will be happy if you help me to get the right naming
>> convention
>> such like what you said, I think in my case it will be a viewer, right?
>> after
>> testing I will search on some places to work on a physical model.
>>
>> Now I am working on two machines, one with orocos and RT Linux, and the
>> other
>> one generic Linux and the simulation.
>>
>
> The screen shoot didn't attached to mail, but I understand the idea. When
> you say :
> "trajectory to follow, and according to recording data from the sensor the
> car
> will move"
> which part of the SW is controlling the car ? the RT computer or the
> computer in simulation ?
>
> If your car is moving in simulation you obviously have a physical model,
> even if it's a simple one.
>
> You did not answered to all questions, could you please detail those :
> What is the aim of your project, what are you trying to do ?
> Do you have other sensors integrated in your simulation outside some
> orocos components or is it the first time you assemble everything ?
>
> Is Orocos or any other framework already running on your simulation PC ?
> are you using Qt as a framework ?
>
> As far as I understand what you are doing I would design a Corba proxy of
> your RT code on the simulation PC and a wrapper to connect this proxy into
> your simulation. Basically it means a getSensor() or notifySensorValue(x)
> method depending if your are doing polling or event driven design.
>
> If your simulation tool doesn't propose any hooks to let data coming from
> outside, you'd better begin with creating this interface before doing
> anything else.
>
> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>
>

Geometry - Visualization libQGLViewer

2015-04-07 10:48 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:

> could you provide any useful links or explanation for How To Start?
>
>
There is no standard answer to this, it's general software architecture,
being develop in C++ against OpenGl doesn't matter.

> about my simulation it is developed using C++, OpenGL. about the component
> it
> is a simple one which read data from a sensor, and write it in the output
> port.
>
>
Here is a bunch a question to understand well what you are trying to do :

What do you call "simulation" ?
is it a viewer ?
is it a physical model running instead the real captors/actuators ?
Is it both ?
are they decoupled ?
What is its aim ?
Is your embedded component running on the same computer as your simulation ?
Do you have other sensors integrated in your simulation outside some orocos
components or is it the first time you assemble everything ?

thanks,,
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Geometry - Visualization libQGLViewer

SimulationSimulation

this is a screen shoot from my simulation, it is just represent a car and trajectory to follow, and according to recording data from the sensor the car will move. I will be happy if you help me to get the right naming convention such like what you said, I think in my case it will be a viewer, right? after testing I will search on some places to work on a physical model.

Now I am working on two machines, one with orocos and RT Linux, and the other one generic Linux and the simulation.

Geometry - Visualization libQGLViewer

2015-04-07 4:47 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:

> To be honest I am confused, and don't know what should I do now.
> Your previous reply was very interesting to me and I learned a lot from
> shareing your experience.
>
> But Now my case is little bet harder than the first. Now I have a big
> simulation project developed in C++ and OpenGL, and this is the simulation
> which I want to use to visualize my developed Orocos components.
>
> As I said and got from all of your replies it is not the right way to
> develop
> it inside orocos component, and as far as I understand your reply, I have
> to
> redevelop my simulation

NO ! You just have to establish a communication layer between your existing
simulation code and the code you want to test in simulation. If it's a
simulation project you already have hooks to get/send datas from/to your
tested code.

> to be able to chat on Corba. right?!
>
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Geometry - Visualization libQGLViewer

could you provide any useful links or explanation for How To Start?

about my simulation it is developed using C++, OpenGL. about the component it is a simple one which read data from a sensor, and write it in the output port.

thanks,,

Geometry - Visualization libQGLViewer

2015-04-03 6:50 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:

> Thank you Ruben,
>
> Actually my problem is to understand how to do?
> And I don't know why I couldn't get it? But if you can say it in clear
> words
> as if I am a student :)
>
> I checked all your mentioned links, and below you can find what I did and
> what i got:
>
> Point 1. for the part of the typekit and my custom data type, I couldn't
> use
> orocos_typegen_headers cmake macro. Somehow it was succeeded to create the
> files, but failed in the installation.
> So I had to write my own code to marshalling and de-marshalling my own
> custom
> data type in each component. and this is a good solution for now.
>
> My Notes about Point 1:
> 1. My Orocos has been installed in /opt/orocos/orocos-toolchain
> 2. The typegen macro install the created files in wrong folders even there
> is
> some folders is not exists.
> 3. The Custom data type is too complex with nested custom data and a lot of
> private members -is this effect-
>
>
> Point 2. How should I create a visualizer? actually the first thing I
> thought
> about is to create a component using orocreatpkg and write some OpenGL code
> in the start and update hooks. Then I faced some issues, so I decided to
> use
> QGL Viewer with my OpenGL code.
> Everything is going ok and the component now compiled correctly but doesn't
> run as expected. after debugging we found that if the viewer window
> started
> the component looks to be paused until closing the viewer window.
>
> I don't know what should I do?

As far as I understand your request, your are trying to run a QT graphical
application in an Orocos component. Maybe you should begin with a simple QT
application without OpenGL. You will certainly need a nonblocking
"main_gui()" loop so that you can control how data are shared between the
QT world and the orocos one. I'm sorry I don't know how QT works so I can't
help, but this question would better fit on a Qt mailing list.

As Herman said at the beginning, in your case it's maybe not a good idead
to implementa QT gui inside an *Orocos* component. You may be able to
simple write your gui in an application chatting on Corba (as your Orocos
component is in a dedicated process who exports its dataflow by corba).
Then it's the same thing as doing any graphical communicating application
where Qt certainly has its own solutions.

What can help you is to ask yourself what you would have done without the
help of frameworks. In your case imagine you have a simple robot code that
is periodically incrementing a counter, and another gui application showing
this counter. How do you do that ?

To share my experience, I wrote a ROS node in order to run a pygtk gui in
python. The communication is done via ROS-to-Orocos topic-to-port streams.
A low frequency low priority component is preparing data on the orocos side
(to prevent HMI receiving a 10ms data rate). On the ros side I have one
thread running a blocking gui and a thread handling the communication. Both
being mutexly protected. Why didn't I do the in the Orocos world ? because :
1/ I can't run an easy-and-quick-developed python HMI in Orocos
2/ ROS doesn't manage threading so I can do whatever I need from the GUI
framework side. Nothing prevents you from calling a "pthread_create" inside
an Orocos component to do the same thing, but that's going against Orocos
principles ... meaning that it's not the right framework to do that.

> It will be nice if you have any simple example
> that can i follow!!
>
> Thank you very much!!
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Geometry - Visualization libQGLViewer

To be honest I am confused, and don't know what should I do now. Your previous reply was very interesting to me and I learned a lot from shareing your experience.

But Now my case is little bet harder than the first. Now I have a big simulation project developed in C++ and OpenGL, and this is the simulation which I want to use to visualize my developed Orocos components.

As you said and I got from all of your replies it is not the right way to develop it inside orocos component, and as far as I understand your reply, I have to redevelop my simulation to be able to chat on Corba. right?!

Geometry - Visualization libQGLViewer

Hello,

This is an interesting discussion, thus I would like to share my experience.

In out setting we have two computers: RT-machine (Linux+RT_PREEMPT+Orocos)
and a "ground station" machine (Linux). We made some visualization software
using ZeroMQ, Google Protobufs, and pyqtgraph (in short, QT based line
plotter in Python). It's more like proof of concept, not so much automated
but it could be. BTW, we don't use ROS at all.

RT machine:
So, each component whose output port data we want to visualize has a
typekit. Then we create protobuf message, almost 1-1 as the typekit one,
and generate the c++ code for it. A dedicated Telemetry component does
stupid copying: input port data -> protobuf message. The messages are
broadcasted with ZeroMQ. Telemetry components are non-RT (SCHED_OTHER). The
RT component and it's Telemetry component are connected with non-buffered
connections, thus favoring most recent data. We don't care about missed
data, since we use reporters to log data.

Ground station:
- everything is in Python
- we use the same protobuf specs to generate Python bindings.
- Online: the messages are decoded and sent to line plotters.

So, the RT machine just publishes data, using ZeroMQ. No plotting stuff
here. Since we use PUB-SUB with ZeroMQ, "any" number of machines can
subscribe -- we tried with 2-3 machines at the same time.

Here is how it looks in the end https://youtu.be/qta9N8gNRyk (look at the
middle screen). The PCs are connected via WiFi. Delays are negligible, say
< 1s (my very subjective estimation), which is -- at least for me -- just
fine.

If anyone would be interested, I can release some code in the near future.

Cheers,
Milan

On Fri, Apr 3, 2015 at 12:57 PM, Willy Lambert <lambert [dot] willy [..] ...>
wrote:

>
>
> 2015-04-03 6:50 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:
>
>> Thank you Ruben,
>>
>> Actually my problem is to understand how to do?
>> And I don't know why I couldn't get it? But if you can say it in clear
>> words
>> as if I am a student :)
>>
>> I checked all your mentioned links, and below you can find what I did and
>> what i got:
>>
>> Point 1. for the part of the typekit and my custom data type, I couldn't
>> use
>> orocos_typegen_headers cmake macro. Somehow it was succeeded to create the
>> files, but failed in the installation.
>> So I had to write my own code to marshalling and de-marshalling my own
>> custom
>> data type in each component. and this is a good solution for now.
>>
>> My Notes about Point 1:
>> 1. My Orocos has been installed in /opt/orocos/orocos-toolchain
>> 2. The typegen macro install the created files in wrong folders even
>> there is
>> some folders is not exists.
>> 3. The Custom data type is too complex with nested custom data and a lot
>> of
>> private members -is this effect-
>>
>>
>> Point 2. How should I create a visualizer? actually the first thing I
>> thought
>> about is to create a component using orocreatpkg and write some OpenGL
>> code
>> in the start and update hooks. Then I faced some issues, so I decided to
>> use
>> QGL Viewer with my OpenGL code.
>> Everything is going ok and the component now compiled correctly but
>> doesn't
>> run as expected. after debugging we found that if the viewer window
>> started
>> the component looks to be paused until closing the viewer window.
>>
>> I don't know what should I do?
>
>
> As far as I understand your request, your are trying to run a QT graphical
> application in an Orocos component. Maybe you should begin with a simple QT
> application without OpenGL. You will certainly need a nonblocking
> "main_gui()" loop so that you can control how data are shared between the
> QT world and the orocos one. I'm sorry I don't know how QT works so I can't
> help, but this question would better fit on a Qt mailing list.
>
> As Herman said at the beginning, in your case it's maybe not a good idead
> to implementa QT gui inside an *Orocos* component. You may be able to
> simple write your gui in an application chatting on Corba (as your Orocos
> component is in a dedicated process who exports its dataflow by corba).
> Then it's the same thing as doing any graphical communicating application
> where Qt certainly has its own solutions.
>
> What can help you is to ask yourself what you would have done without the
> help of frameworks. In your case imagine you have a simple robot code that
> is periodically incrementing a counter, and another gui application showing
> this counter. How do you do that ?
>
>
> To share my experience, I wrote a ROS node in order to run a pygtk gui in
> python. The communication is done via ROS-to-Orocos topic-to-port streams.
> A low frequency low priority component is preparing data on the orocos side
> (to prevent HMI receiving a 10ms data rate). On the ros side I have one
> thread running a blocking gui and a thread handling the communication. Both
> being mutexly protected. Why didn't I do the in the Orocos world ? because :
> 1/ I can't run an easy-and-quick-developed python HMI in Orocos
> 2/ ROS doesn't manage threading so I can do whatever I need from the GUI
> framework side. Nothing prevents you from calling a "pthread_create" inside
> an Orocos component to do the same thing, but that's going against Orocos
> principles ... meaning that it's not the right framework to do that.
>
>
>
>> It will be nice if you have any simple example
>> that can i follow!!
>>
>> Thank you very much!!
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>

Geometry - Visualization libQGLViewer

2015-04-03 14:25 GMT+02:00 Milan Vukov <mvukov [..] ...>:

> Hello,
>
> This is an interesting discussion, thus I would like to share my
> experience.
>
> In out setting we have two computers: RT-machine (Linux+RT_PREEMPT+Orocos)
> and a "ground station" machine (Linux). We made some visualization software
> using ZeroMQ, Google Protobufs, and pyqtgraph (in short, QT based line
> plotter in Python). It's more like proof of concept, not so much automated
> but it could be. BTW, we don't use ROS at all.
>
> RT machine:
> So, each component whose output port data we want to visualize has a
> typekit. Then we create protobuf message, almost 1-1 as the typekit one,
> and generate the c++ code for it. A dedicated Telemetry component does
> stupid copying: input port data -> protobuf message. The messages are
> broadcasted with ZeroMQ. Telemetry components are non-RT (SCHED_OTHER). The
> RT component and it's Telemetry component are connected with non-buffered
> connections, thus favoring most recent data. We don't care about missed
> data, since we use reporters to log data.
>
> Ground station:
> - everything is in Python
> - we use the same protobuf specs to generate Python bindings.
> - Online: the messages are decoded and sent to line plotters.
>
> So, the RT machine just publishes data, using ZeroMQ. No plotting stuff
> here. Since we use PUB-SUB with ZeroMQ, "any" number of machines can
> subscribe -- we tried with 2-3 machines at the same time.
>
> Here is how it looks in the end https://youtu.be/qta9N8gNRyk (look at the
> middle screen). The PCs are connected via WiFi. Delays are negligible, say
> < 1s (my very subjective estimation), which is -- at least for me -- just
> fine.
>
> If anyone would be interested, I can release some code in the near future.
>
> Cheers,
> Milan
>
>
Thanks for sharing,I also forgot to point this important thing, you may
have to connect several HMI on the same real time code, and/or connect the
HMI in simulation or with the real robot on the same/different computer.

>
>
>
> On Fri, Apr 3, 2015 at 12:57 PM, Willy Lambert <lambert [dot] willy [..] ...>
> wrote:
>
>>
>>
>> 2015-04-03 6:50 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:
>>
>>> Thank you Ruben,
>>>
>>> Actually my problem is to understand how to do?
>>> And I don't know why I couldn't get it? But if you can say it in clear
>>> words
>>> as if I am a student :)
>>>
>>> I checked all your mentioned links, and below you can find what I did and
>>> what i got:
>>>
>>> Point 1. for the part of the typekit and my custom data type, I couldn't
>>> use
>>> orocos_typegen_headers cmake macro. Somehow it was succeeded to create
>>> the
>>> files, but failed in the installation.
>>> So I had to write my own code to marshalling and de-marshalling my own
>>> custom
>>> data type in each component. and this is a good solution for now.
>>>
>>> My Notes about Point 1:
>>> 1. My Orocos has been installed in /opt/orocos/orocos-toolchain
>>> 2. The typegen macro install the created files in wrong folders even
>>> there is
>>> some folders is not exists.
>>> 3. The Custom data type is too complex with nested custom data and a lot
>>> of
>>> private members -is this effect-
>>>
>>>
>>> Point 2. How should I create a visualizer? actually the first thing I
>>> thought
>>> about is to create a component using orocreatpkg and write some OpenGL
>>> code
>>> in the start and update hooks. Then I faced some issues, so I decided to
>>> use
>>> QGL Viewer with my OpenGL code.
>>> Everything is going ok and the component now compiled correctly but
>>> doesn't
>>> run as expected. after debugging we found that if the viewer window
>>> started
>>> the component looks to be paused until closing the viewer window.
>>>
>>> I don't know what should I do?
>>
>>
>> As far as I understand your request, your are trying to run a QT
>> graphical application in an Orocos component. Maybe you should begin with a
>> simple QT application without OpenGL. You will certainly need a nonblocking
>> "main_gui()" loop so that you can control how data are shared between the
>> QT world and the orocos one. I'm sorry I don't know how QT works so I can't
>> help, but this question would better fit on a Qt mailing list.
>>
>> As Herman said at the beginning, in your case it's maybe not a good idead
>> to implementa QT gui inside an *Orocos* component. You may be able to
>> simple write your gui in an application chatting on Corba (as your Orocos
>> component is in a dedicated process who exports its dataflow by corba).
>> Then it's the same thing as doing any graphical communicating application
>> where Qt certainly has its own solutions.
>>
>> What can help you is to ask yourself what you would have done without the
>> help of frameworks. In your case imagine you have a simple robot code that
>> is periodically incrementing a counter, and another gui application showing
>> this counter. How do you do that ?
>>
>>
>> To share my experience, I wrote a ROS node in order to run a pygtk gui in
>> python. The communication is done via ROS-to-Orocos topic-to-port streams.
>> A low frequency low priority component is preparing data on the orocos side
>> (to prevent HMI receiving a 10ms data rate). On the ros side I have one
>> thread running a blocking gui and a thread handling the communication. Both
>> being mutexly protected. Why didn't I do the in the Orocos world ? because :
>> 1/ I can't run an easy-and-quick-developed python HMI in Orocos
>> 2/ ROS doesn't manage threading so I can do whatever I need from the GUI
>> framework side. Nothing prevents you from calling a "pthread_create" inside
>> an Orocos component to do the same thing, but that's going against Orocos
>> principles ... meaning that it's not the right framework to do that.
>>
>>
>>
>>> It will be nice if you have any simple example
>>> that can i follow!!
>>>
>>> Thank you very much!!
>>> --
>>> Orocos-Users mailing list
>>> Orocos-Users [..] ...
>>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>>
>>
>>
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>>
>
>
> --
> Milan Vukov, PhD Student
> KU Leuven, Department of Electrical Engineering (ESAT)
> STADIUS Center for Dynamical Systems, Signal Processing and Data Analytics
> Kasteelpark Arenberg 10, bus 2446, B-3001 Leuven-Heverlee, Belgium
> e-mail: milan [dot] vukov [..] ...
> url: http://homes.esat.kuleuven.be/~mvukov/
> phone: +32-479-813256 (BE), +381-64-1541622 (SR)
> disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>

Geometry - Visualization libQGLViewer

Thanx for the reply.

Well, in our case we didn't need the feature to communicate with the RT
machine via GUI. We do it via standard OROCOS deployer from command line
(there is one more screen in the lab, hidden on the left :)). So,
uni-directional connection to the ground station was just fine.

Regarding a simulator: I have built a single component to simulate system
dynamics, sensor noise, and sensor/actuator delays (OK, the last one is
WIP). That single component has multiple ports, with exactly the same data
types on ports as the "real" sensor/actuator components have. So, switching
to the simulator in our case is just rerouting the connections. In my eyes,
this was the simplest way (other people had different opinion, e.g. that
there should be multiple simulators for different "physical" components).

@AlaaEldeen: I am not sure what you try to achieve, but in my previous
email I tried to explain how we solved issues regarding visualization; here
also I explained how we created a simulator. In our case running
visualization software on the RT machine was not possible: 1) the PC is
mounted on the apparatus, 2) The system is already under heavy load, we use
6 out of 8 cores. On the other hand, I think it more easier to maintain a
visualization tool as a separate app.

Regards,
Milan

On Fri, Apr 3, 2015 at 4:11 PM, Willy Lambert <lambert [dot] willy [..] ...>
wrote:
>
>
>
> 2015-04-03 14:25 GMT+02:00 Milan Vukov <mvukov [..] ...>:
>>
>> Hello,
>>
>> This is an interesting discussion, thus I would like to share my
experience.
>>
>> In out setting we have two computers: RT-machine
(Linux+RT_PREEMPT+Orocos) and a "ground station" machine (Linux). We made
some visualization software using ZeroMQ, Google Protobufs, and pyqtgraph
(in short, QT based line plotter in Python). It's more like proof of
concept, not so much automated but it could be. BTW, we don't use ROS at
all.
>>
>> RT machine:
>> So, each component whose output port data we want to visualize has a
typekit. Then we create protobuf message, almost 1-1 as the typekit one,
and generate the c++ code for it. A dedicated Telemetry component does
stupid copying: input port data -> protobuf message. The messages are
broadcasted with ZeroMQ. Telemetry components are non-RT (SCHED_OTHER). The
RT component and it's Telemetry component are connected with non-buffered
connections, thus favoring most recent data. We don't care about missed
data, since we use reporters to log data.
>>
>> Ground station:
>> - everything is in Python
>> - we use the same protobuf specs to generate Python bindings.
>> - Online: the messages are decoded and sent to line plotters.
>>
>> So, the RT machine just publishes data, using ZeroMQ. No plotting stuff
here. Since we use PUB-SUB with ZeroMQ, "any" number of machines can
subscribe -- we tried with 2-3 machines at the same time.
>>
>> Here is how it looks in the end https://youtu.be/qta9N8gNRyk (look at
the middle screen). The PCs are connected via WiFi. Delays are negligible,
say < 1s (my very subjective estimation), which is -- at least for me --
just fine.
>>
>> If anyone would be interested, I can release some code in the near
future.
>>
>> Cheers,
>> Milan
>>
>
> Thanks for sharing,I also forgot to point this important thing, you may
have to connect several HMI on the same real time code, and/or connect the
HMI in simulation or with the real robot on the same/different computer.
>
>>
>>
>>
>>
>> On Fri, Apr 3, 2015 at 12:57 PM, Willy Lambert <lambert [dot] willy [..] ...>
wrote:
>>>
>>>
>>>
>>> 2015-04-03 6:50 GMT+02:00 <alaaeldeen [dot] abdalrahman [..] ....j

:
>>>>
>>>> Thank you Ruben,
>>>>
>>>> Actually my problem is to understand how to do?
>>>> And I don't know why I couldn't get it? But if you can say it in clear
words
>>>> as if I am a student :)
>>>>
>>>> I checked all your mentioned links, and below you can find what I did
and
>>>> what i got:
>>>>
>>>> Point 1. for the part of the typekit and my custom data type, I
couldn't use
>>>> orocos_typegen_headers cmake macro. Somehow it was succeeded to create
the
>>>> files, but failed in the installation.
>>>> So I had to write my own code to marshalling and de-marshalling my own
custom
>>>> data type in each component. and this is a good solution for now.
>>>>
>>>> My Notes about Point 1:
>>>> 1. My Orocos has been installed in /opt/orocos/orocos-toolchain
>>>> 2. The typegen macro install the created files in wrong folders even
there is
>>>> some folders is not exists.
>>>> 3. The Custom data type is too complex with nested custom data and a
lot of
>>>> private members -is this effect-
>>>>
>>>>
>>>> Point 2. How should I create a visualizer? actually the first thing I
thought
>>>> about is to create a component using orocreatpkg and write some OpenGL
code
>>>> in the start and update hooks. Then I faced some issues, so I decided
to use
>>>> QGL Viewer with my OpenGL code.
>>>> Everything is going ok and the component now compiled correctly but
doesn't
>>>> run as expected. after debugging we found that if the viewer window
started
>>>> the component looks to be paused until closing the viewer window.
>>>>
>>>> I don't know what should I do?
>>>
>>>
>>> As far as I understand your request, your are trying to run a QT
graphical application in an Orocos component. Maybe you should begin with a
simple QT application without OpenGL. You will certainly need a nonblocking
"main_gui()" loop so that you can control how data are shared between the
QT world and the orocos one. I'm sorry I don't know how QT works so I can't
help, but this question would better fit on a Qt mailing list.
>>>
>>> As Herman said at the beginning, in your case it's maybe not a good
idead to implementa QT gui inside an *Orocos* component. You may be able to
simple write your gui in an application chatting on Corba (as your Orocos
component is in a dedicated process who exports its dataflow by corba).
Then it's the same thing as doing any graphical communicating application
where Qt certainly has its own solutions.
>>>
>>> What can help you is to ask yourself what you would have done without
the help of frameworks. In your case imagine you have a simple robot code
that is periodically incrementing a counter, and another gui application
showing this counter. How do you do that ?
>>>
>>>
>>> To share my experience, I wrote a ROS node in order to run a pygtk gui
in python. The communication is done via ROS-to-Orocos topic-to-port
streams. A low frequency low priority component is preparing data on the
orocos side (to prevent HMI receiving a 10ms data rate). On the ros side I
have one thread running a blocking gui and a thread handling the
communication. Both being mutexly protected. Why didn't I do the in the
Orocos world ? because :
>>> 1/ I can't run an easy-and-quick-developed python HMI in Orocos
>>> 2/ ROS doesn't manage threading so I can do whatever I need from the
GUI framework side. Nothing prevents you from calling a "pthread_create"
inside an Orocos component to do the same thing, but that's going against
Orocos principles ... meaning that it's not the right framework to do that.
>>>
>>>
>>>>
>>>> It will be nice if you have any simple example
>>>> that can i follow!!
>>>>
>>>> Thank you very much!!
>>>> --
>>>> Orocos-Users mailing list
>>>> Orocos-Users [..] ...
>>>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>>
>>>
>>>
>>> --
>>> Orocos-Users mailing list
>>> Orocos-Users [..] ...
>>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>>
>>
>>
>>
>> --
>> Milan Vukov, PhD Student
>> KU Leuven, Department of Electrical Engineering (ESAT)
>> STADIUS Center for Dynamical Systems, Signal Processing and Data
Analytics
>> Kasteelpark Arenberg 10, bus 2446, B-3001 Leuven-Heverlee, Belgium
>> e-mail: milan [dot] vukov [..] ...
>> url: http://homes.esat.kuleuven.be/~mvukov/
>> phone: +32-479-813256 (BE), +381-64-1541622 (SR)
>> disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>
>

--
Milan Vukov, PhD Student
KU Leuven, Department of Electrical Engineering (ESAT)
STADIUS Center for Dynamical Systems, Signal Processing and Data Analytics
Kasteelpark Arenberg 10, bus 2446, B-3001 Leuven-Heverlee, Belgium
e-mail: milan [dot] vukov [..] ...
url: http://homes.esat.kuleuven.be/~mvukov/
phone: +32-479-813256 (BE), +381-64-1541622 (SR)
disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

Geometry - Visualization libQGLViewer

Thanks for Your great advise and I thought that I did the same, I have 2 components one for the functionalists, and another one on another machine for visualization, using CORBA and ORBomni this two components are connected.

My problem is that "How to integrate qgl in a component project?" or maybe this is a wrong question?

Thanks

Geometry - Visualization libQGLViewer

On Wed, 1 Apr 2015, alaaeldeen [dot] abdalrahman [..] ... wrote:

> Thanks for Your great advise and I thought that I did the same, I have 2
> components one for the functionalists, and another one on another machine for
> visualization, using CORBA and ORBomni this two components are connected.
>
> My problem is that "How to integrate qgl in a component project?" or maybe
> this is a wrong question?

the Qgl is just a function call that you can connect to one of the hooks
that an RTT component provides: from the OS, or from a communication port.

> Thanks

Herman

Geometry - Visualization libQGLViewer

I can not see it easy like that, or I did not understand. please can you
describe with some details?

On Wed, Apr 1, 2015 at 7:28 PM, Herman Bruyninckx <
Herman [dot] Bruyninckx [..] ...> wrote:

> On Wed, 1 Apr 2015, alaaeldeen [dot] abdalrahman [..] ... wrote:
>
> Thanks for Your great advise and I thought that I did the same, I have 2
>> components one for the functionalists, and another one on another machine
>> for
>> visualization, using CORBA and ORBomni this two components are connected.
>>
>> My problem is that "How to integrate qgl in a component project?" or maybe
>> this is a wrong question?
>>
>
> the Qgl is just a function call that you can connect to one of the hooks
> that an RTT component provides: from the OS, or from a communication port.
>
> Thanks
>>
>
> Herman
>

Ruben Smits's picture

Geometry - Visualization libQGLViewer

On Thu, Apr 2, 2015 at 2:21 AM, <alaaeldeen [dot] abdalrahman [..] ....j

wrote:

> First thanks for your suggestion. Let me put it in Points like what I did.
>
> 1. Using Orocos component builder's manual, An Application have been
> created
> with two components in it, with ports connected to each others. and the
> first
> one sending random numbers to the second one.
>
> 2. Using Orocos component builder's manual, and some other resources, my
> system has been installed to support CORBA and ORBOmni, then the previous
> Application converted to be two different components each one running on
> different machine and the first one sending random numbers to the second
> one
> through the network.
>
> 3. Now the First Components used to read data from IMU sensor then sending
> it
> to the second Component which is suppose to visualize this data using QGL
> viewer. But I faced some issues in this steps.
>
>
>
> This issues are:
>
> a. The First Component developed to send Custom data Type which is not
> known
> by OROCOS or CORBA, then the context will ignore to create the output port
> for the CORBA component until adding this Type to OROCOS Types.
>

How did you create the typekit/corba transportkit for your custom data
type? Using the orocos_typegen_headers cmake macro? See
http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/rtt_cheat_sh...
or
https://github.com/orocos-toolchain/rtt/blob/master/UseOROCOS-RTT.cmake#...
for more information

>
> b. I don't know how it is suppose to Use QGL Viewer? am I suppose to
> create a
> separate application, should I wrote the code in the second component, or
> it
> is just a function and easy to call like Herman replied above?
>

Personnally I would not put the controller part and the viewer part in the
same application. Whether the viewer part should be based on Orocos
components is up to you, but it does not have to be, it does not even have
to C++ but can be in any other language that has corba support. The viewer
can get a hold of the remote component more or less like:

// Setup Corba:
TaskContextServer
<http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_1corba_1_1TaskContextServer.html>::InitOrb(argc,
argv);

// Setup a thread to handle call-backs to our components.
TaskContextServer
<http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_1corba_1_1TaskContextServer.html>::ThreadOrb();

// Get a pointer to the component above
TaskContext
<http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_1TaskContext.html>*
component = TaskContextProxy::Create( "HelloWorld" );

At this moment you can use the component as it would be a local object.
More info can be found here:
http://www.orocos.org/stable/documentation/rtt/v2.x/doc-xml/orocos-trans...

>
>
> What I did for the first issue is to serialize all the coming data before
> sending it to the second component, which is allowed me to send it as a
> string which is predefined in OROCOS type.
>

I would suggest to use typegen to generate typekits and transportkits for
your types as described above.

R.

>
> Thanks,,
>
>
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Geometry - Visualization libQGLViewer

Thank you Ruben,

Actually my problem is to understand how to do? And I don't know why I couldn't get it? But if you can say it in clear words as if I am a student :)

I checked all your mentioned links, and below you can find what I did and what i got:

Point 1. for the part of the typekit and my custom data type, I couldn't use orocos_typegen_headers cmake macro. Somehow it was succeeded to create the files, but failed in the installation. So I had to write my own code to marshalling and de-marshalling my own custom data type in each component. and this is a good solution for now.

My Notes about Point 1: 1. My Orocos has been installed in /opt/orocos/orocos-toolchain 2. The typegen macro install the created files in wrong folders even there is some folders is not exists. 3. The Custom data type is too complex with nested custom data and a lot of private members -is this effect-

Point 2. How should I create a visualizer? actually the first thing I thought about is to create a component using orocreatpkg and write some OpenGL code in the start and update hooks. Then I faced some issues, so I decided to use QGL Viewer with my OpenGL code. Everything is going ok and the component now compiled correctly but doesn't run as expected. after debugging we found that if the viewer window started the component looks to be paused until closing the viewer window.

I don't know what should I do? It will be nice if you have any simple example that can i follow!!

Thank you very much!!

Geometry - Visualization libQGLViewer

In the case of rock (www.rock-robotics.org) we use the following approach:

* Embed the GUI in a qt designer plugin which uses qt slots and signals as setter and getter
http://www.rock-robotics.org/stable/documentation/advanced_tutorials/300...
https://techbase.kde.org/Development/Tutorials/Writing_Qt_Designer_Plugins

* use qtruby to load the plugin from ruby

* use orocos.rb to connect the qt designer plugin with orocos tasks via corba
— event based, on_data, on_reachable, …
— supports asynchronous access using a thread pool behind the scene
— supports auto reconnect
http://www.rock-robotics.org/stable/documentation/graphical_user_interfa...

We also have a light weiht Qt 3D viewer supporting a plugin system for displaying sensor data. Any contribution is welcome.
https://github.com/rock-core/gui-vizkit3d

Alex

Am 01.04.2015 um 12:32 schrieb AlaaEldeen, AbdAlrahman <alaaeldeen [dot] abdalrahman [..] ....j

:

> I can not see it easy like that, or I did not understand. please can you describe with some details?
>
> On Wed, Apr 1, 2015 at 7:28 PM, Herman Bruyninckx <Herman [dot] Bruyninckx [..] ...> wrote:
> On Wed, 1 Apr 2015, alaaeldeen [dot] abdalrahman [..] ... wrote:
>
> Thanks for Your great advise and I thought that I did the same, I have 2
> components one for the functionalists, and another one on another machine for
> visualization, using CORBA and ORBomni this two components are connected.
>
> My problem is that "How to integrate qgl in a component project?" or maybe
> this is a wrong question?
>
> the Qgl is just a function call that you can connect to one of the hooks
> that an RTT component provides: from the OS, or from a communication port.
>
> Thanks
>
> Herman
>

Geometry - Visualization libQGLViewer

Thanks, I really appreciate that. This is my first time having a look on Rock, and it is looks has a lot of great features.. But in my case I am using orocos-toolchain, and I am still a beginner trying to start with Real time development. Do you think that I will need a lot of work to do a simple application using OROCOS Component and OpenGL Application to visualize the Data.

Thanks for your help,,

Geometry - Visualization libQGLViewer

I suggest the Orocos component builder's manual, and when you are done with your realtime part, go to chapter 4, Distributing OROCOS components with CORBA (see code exemple).

When you will be done, you will have proxy components able to "mirror" your realtime components. Then you will be ready to add a GUI.

That is how i would do it.

Regards.

Paul.

On 04/01/2015 12:32 PM, AlaaEldeen, AbdAlrahman wrote:
> I can not see it easy like that, or I did not understand. please can you
> describe with some details?
>
> On Wed, Apr 1, 2015 at 7:28 PM, Herman Bruyninckx <
> Herman [dot] Bruyninckx [..] ...> wrote:
>
>> On Wed, 1 Apr 2015, alaaeldeen [dot] abdalrahman [..] ... wrote:
>>
>> Thanks for Your great advise and I thought that I did the same, I have 2
>>> components one for the functionalists, and another one on another machine
>>> for
>>> visualization, using CORBA and ORBomni this two components are connected.
>>>
>>> My problem is that "How to integrate qgl in a component project?" or maybe
>>> this is a wrong question?
>>>
>>
>> the Qgl is just a function call that you can connect to one of the hooks
>> that an RTT component provides: from the OS, or from a communication port.
>>
>> Thanks
>>>
>>
>> Herman
>>
>
>
>

Geometry - Visualization libQGLViewer

First thanks for your suggestion. Let me put it in Points like what I did.

1. Using Orocos component builder's manual, An Application have been created with two components in it, with ports connected to each others. and the first one sending random numbers to the second one.

2. Using Orocos component builder's manual, and some other resources, my system has been installed to support CORBA and ORBOmni, then the previous Application converted to be two different components each one running on different machine and the first one sending random numbers to the second one through the network.

3. Now the First Components used to read data from IMU sensor then sending it to the second Component which is suppose to visualize this data using QGL viewer. But I faced some issues in this steps.

This issues are:

a. The First Component developed to send Custom data Type which is not known by OROCOS or CORBA, then the context will ignore to create the output port for the CORBA component until adding this Type to OROCOS Types.

b. I don't know how it is suppose to Use QGL Viewer? am I suppose to create a separate application, should I wrote the code in the second component, or it is just a function and easy to call like Herman replied above?

What I did for the first issue is to serialize all the coming data before sending it to the second component, which is allowed me to send it as a string which is predefined in OROCOS type.

Thanks,,