Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added article about ROS 2.0 in realtime #35

Merged
merged 9 commits into from
Jul 14, 2015
Merged

Added article about ROS 2.0 in realtime #35

merged 9 commits into from
Jul 14, 2015

Conversation

jacquelinekay
Copy link
Contributor

This article summarizes my research into real-time software development techniques, with a focus on C/C++ running on RTLinux or a Linux-based RTOS. It lays out a tentative plan for how to benchmark real-time performance in ROS 2.0 and how existing and future code in the core communication stack can be made real-time-safe.

@jacquelinekay jacquelinekay added the in progress Actively being worked on (Kanban column) label Jun 23, 2015
In general, an operating system can guarantee that the tasks it handles for the developer, such as
thread scheduling, are deterministic, but the OS may not guarantee that the developer's code will
run in real-time. Therefore, it is up to the developer to know what the determinstic guarantees
of an existing system are, and what she must do to write hard real-time code on top of the OS.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

she 👍

@dirk-thomas
Copy link
Member

In general please start each sentence on a new line. It simply prevents changes to one location to propagate through a whole paragraph and result in huge diffs.

as the variable deviation between a task's deadline and its actual time of completion. A more jittery
system is less deterministic, less predictable, and less real-time. Though in practice it is impossible
to completely eliminate jitter from a real-time system, it is a worthy goal to determine a hard upper bound
for jitter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just reference existing definition(s) of real-time rather than describing it on our own?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to summarize the existing definition in this document. Do you prefer a verbatim quote from an existing document?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just reference external resources. Less text = less to maintain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dissenting opinion: The reference text shouldn't be changing and it is annoying to have to open and read another (potentially large) document to get the meaning. I think it is totally appropriate to quote a snippet of the referenced text or summarize it in this document to make it more self contained. Part of the job of the document is to distill the subject matter into an easy to digest form.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dissent +1: I think it is a nice summary

@jacquelinekay jacquelinekay added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Jun 23, 2015
</div>

Original Author: {{ page.author }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to start a summary of the document, stating its scope, goal and structure.

@adolfo-rt
Copy link

General comment. How do you feel about citing references in the running text?. It can quickly become hard to identify where the reference is used in the text.

memset(dummy, 0, MAX_SAFE_STACK);
```

`mlockall` is a Linux system call for locking the process's virtual address space into RAM, preventing the memory that will be accessed by the process from getting paged into swap space.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mlockall hyperlink or [ref], for convenient jumping to the source?.

Create threads at the start of the program.
This confines the nondeterministic overhead of thread allocation to a defined point in the process.

Create high priority (but not 99) threads with a FIFO or Round Robin scheduler.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or SCHED_DEADLINE, since version 3.14. Source.

@gavanderhoorn
Copy link
Contributor

+1 on all comments by @adolfo-rt, especially those about what appear to be opinions. The RT-field has some very clear definitions this article could re-use, so why not do that.

Also +1 on mentioning Xenomai and all its tools and infrastructure. This may be personal, but I like the co-kernel approach - and the strict separation between primary and secondary modes that it allows - as well.

@jacquelinekay
Copy link
Contributor Author

Thanks for all the comments, @adolfo-rt! I am addressing them in the text now.

The Markdown/Jekyll system we have set up for these documents doesn't support "proper" inline citations, but I'll probably figure out a numbered footnote system for citations, or just add links to sources in the text. We could consider adding more citations to the other ROS 2 design documents, too, but this article in particular synthesizes a lot of established information that is not common knowledge for the average software engineer.

Thanks too for your feedback, @gavanderhoorn. I'll look into setting up a Xenomai machine for the purposes of ROS 2 performance testing.

@gavanderhoorn
Copy link
Contributor

I'll look into setting up a Xenomai machine for the purposes of ROS 2 performance testing.

@jacquelinekay: perhaps the OSADL can help with that? At the 3rd ROS-Industrial conference one of the presentations included an overview of the kind of software testing they do. Testing real-time systems / applications across a wide variety of HW and SW was part of that. I can't link to the slides, but the OSADL Realtime QA Farm page seems to give a good overview of what he presented.

If you really (or also) want to do it yourself: the MachineKit community has pre-built Xenomai debian kernel pkgs that could save you some work.

@jacquelinekay
Copy link
Contributor Author

@adolfo-rt I've incorporated your suggestions in 0990fa3 and 2a13eea.

* Quality of Service: The overall performance of a network. Includes factors such as bandwith, throughput, availability, jitter, latency, and error rates.

Real-time software guarantees correct computation at the correct time.
Hard real-time software systems have a set of strict deadlines, and missing a deadline is considered a system failure.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a line break to separate hard real-time definition to a new paragraph. Also, consider emphasizing the hard, soft, and firm real-time initalics.

@adolfo-rt
Copy link

I added an additional round of minor comments. The document is looking good 👍

TODO: How can ROS 2 be real-time friendly and cross-platform?
Much of the research in this document focuses on achieving real-time on POSIX-compliant Linux systems.

## Implementation strategy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth mentioning explicitly. Using ROS interfaces should be real-time safe (at least within a limited context, like intra-process), setting them up needs not be. In particular, for pub-sub with dynamic-sized data, it should be possible to pre-allocate resources (e.g., resize payload arrays) at setup time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eb93b9a (and other comments)

@gerkey
Copy link
Member

gerkey commented Jul 7, 2015

+1

1 similar comment
@wjwwood
Copy link
Member

wjwwood commented Jul 7, 2015

+1

jacquelinekay added a commit that referenced this pull request Jul 14, 2015
Added article about ROS 2.0 in realtime
@jacquelinekay jacquelinekay merged commit ec5af88 into gh-pages Jul 14, 2015
@jacquelinekay jacquelinekay removed the in review Waiting for review (Kanban column) label Jul 14, 2015
@jacquelinekay jacquelinekay deleted the realtime branch July 14, 2015 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants