OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

OSG & RTOS software architecture


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
The_Dutchman
Newbie


Joined: 28 Sep 2016
Posts: 2

PostPosted: Wed Sep 28, 2016 5:21 am    Post subject:
OSG & RTOS software architecture
Reply with quote

Hi,

This is a more high level software architecture question considering a combination of OSG with a RTOS. My application considers 3D visualization and navigation for automatic machine control. The machine control loop will be implemented on a RTOS. In this control loop also some functions of OSG will perform some 3D calculations. For the RTOS I'm looking into the Xenomai patches for Linux. However this API is written in C while the OSG API is written in C++. I'm familiar with both languages however never attempted to combine 2 API's of different programming languages. Is it even possible what I'm trying to attempt? Any good advice?

Thank you!

Cheers,
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12264

PostPosted: Wed Sep 28, 2016 7:21 am    Post subject:
OSG & RTOS software architecture
Reply with quote

Hi Jan,

On 28 September 2016 at 06:21, Jan Cools <> wrote:
Quote:
This is a more high level software architecture question considering a combination of OSG with a RTOS. My application considers 3D visualization and navigation for automatic machine control. The machine control loop will be implemented on a RTOS. In this control loop also some functions of OSG will perform some 3D calculations. For the RTOS I'm looking into the Xenomai patches for Linux. However this API is written in C while the OSG API is written in C++. I'm familiar with both languages however never attempted to combine 2 API's of different programming languages. Is it even possible what I'm trying to attempt? Any good advice?

Mixing C and C++ libs is what the OSG already does so I wouldn't
expect any issues on this front.

On the real-time front OpenGL/GLES doesn't make any claims, or provide
any controls, for hard real-time. The closest you can get would be
classed as "soft" real-time. On the OSG side you have to work within
this constraint. With "soft" real-time you are working with
operations that will completely within a reasonable time frame but you
won't have guarantees that it will always finish in this time. Things
that cause big deviations would be when your system gets overload and
the driver/OS start having to juggle memory and threads. Your job is
then is make the whole system work efficiently and well balanced so
you don't get close to point where frame time etc. suddenly increase.

OpenThreads that the OSG uses for threading has affinity support that
helps here, and by chance you happen to post while I'm actually
working on making the affinity support in OpenThreads and the OSG more
flexible and controllable, so I'd recommend keeping tabs on this work.

For your own project you'll want to decide what threads you'll be
wanting to run and on what cores. Make sure the OSG/OpenGL side you
stick to efficient fast paths and keep the load well below the maximum
that the system can handle - i.e. you'll need to be conservative with
how much load you push through, so to get the visual quality you want
you may need to be creative to make sure things are done efficiently
rather than just brute forcing things.

I don't have any idea of how much graphics you'll need and how this
relates to the hardware target you have in mind, it could be that you
have simple needs on the graphics side and a very capable system so
you won't need to optimize heavily as you'll be running safely anyway.
So there is chance you won't need to spend time optimizing things on
the OSG/OpenGL side, it all depends upon the requirements of your
project.

If it does turn out you do need to optimize things then be prepared to
have to lean quite a bit about how the hardware/drivers/OpenGL/OSG all
manage data and processing, there are lots of different techniques for
optimizing things so it can be a bit overwhelming to dive in, so I'd
suggest taking it step by step, creating prototypes that flesh out
different bits of what your system needs to do, lean how to do these
tasks efficiently.

In the above, where I write OpenGL I mean desktop OpenGL or OpenGL ES.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
The_Dutchman
Newbie


Joined: 28 Sep 2016
Posts: 2

PostPosted: Wed Sep 28, 2016 7:50 am    Post subject:
Reply with quote

Hello Robert,

Thank you for your clear and elaborate answer. It was very helpful.
I will definitely keep track of your work regarding the OpenThreads.

The only way to find out if soft real-time performs sufficiently is to code prototypes and see system behavior. Furthermore if I oversize the system hardware I will also have less system loading impact. So I will continue on diving in head first writing the first prototype. They only way to find out is to test it I guess. Luckily now I already have the OSG Forum account Wink

Thanks once again!
Back to top
View user's profile Send private message
Jan Ciger
Guest





PostPosted: Wed Sep 28, 2016 3:04 pm    Post subject:
OSG & RTOS software architecture
Reply with quote

On Wed, Sep 28, 2016 at 7:21 AM, Jan Cools < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Hi,

This is a more high level software architecture question considering a combination of OSG with a RTOS. My application considers 3D visualization and navigation for automatic machine control. The machine control loop will be implemented on a RTOS. In this control loop also some functions of OSG will perform some 3D calculations. For the RTOS I'm looking into the Xenomai patches for Linux. However this API is written in C while the OSG API is written in C++. I'm familiar with both languages however never attempted to combine 2 API's of different programming languages. Is it even possible what I'm trying to attempt? Any good advice?

Thank you!




Hello,


You may also want to consider a different architecture - instead of forcing everything to run on the RTOS, with all the complications that brings (RTOS + OpenGL is likely a non starter if you need hard real time, also driver availability/compatibility is an issue), use the RTOS only for time sensitive matters - i.e. the control loop. 


Visualization is unlikely to be time sensitive, so a good solution could be a second computer to run that and have the realtime system share its data with it somehow (networking or even custom hardware if really necessary). 


This sort of setup lets you use smaller real time system where you really need it and run the parts that don't need to be real time (like the visualization) on commodity hardware. Both resulting in a cheaper and most likely more reliable setup as well.


Regards,


J.

------------------
Post generated by Mail2Forum
Back to top
Chris Hanson
Guest





PostPosted: Wed Sep 28, 2016 3:55 pm    Post subject:
OSG & RTOS software architecture
Reply with quote

Jan has a good point here.

We have ported OSG to architectures like the Integrity embedded OS, but OSG cannot and will not ever guarantee hard real time, nor will the OpenGL driver stack.
​If you want to talk about the requirements of your project, email me sometime.

------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Model(s) load ~10 times longer in 3.6... davisjamesf General 16 Wed Jul 04, 2018 7:18 pm View latest post
No new posts Any good site/software to get texture... vinothrajendran4 VirtualPlanetBuilder [vpb] 1 Fri Dec 30, 2016 9:31 am View latest post
No new posts When writing my own software and inte... diwasbhattarai Build system [build] 4 Tue Mar 22, 2016 1:08 pm View latest post
No new posts Google and "Authoritative Distri... Chris Hanson General 9 Mon May 11, 2015 9:30 pm View latest post
No new posts Combining OSG and Qt 5.4 architecture Fawkes General [3rdparty] 1 Wed Apr 15, 2015 8:38 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP