0
$\begingroup$

Rosanswers logo

Hi everybody.

I just controlled two motors using ROS, however it is not a real time process.

I am just wondering what is the best easy way to make a pthread that runs in real time, which control the motors and can easily send messages to other ROS nodes.

Any help will be appreciate it


Originally posted by acp on ROS Answers with karma: 556 on 2012-05-23

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

  1. Do you really need realtime control? At what rate are you trying to control your motors?
  2. As Bence said, a good architecture for doing realtime control in a ROS environment is OROCOS/RTT.
  3. If you just care about publishing from your realtime loops, there is a realtime publisher in the realtime_tools package (http://www.ros.org/wiki/realtime_tools), but I've never used these.

If you create an RTT component, you can make a given input/output port use some ROS message type, and then use the tools in the rtt_ros_integration package to connect that port up to a ROS topic ( http://www.ros.org/wiki/rtt_ros_integration ). The default way to interact with an RTT component is through the OCL Deployer interface, and you can write interpreted scripts for this interface that specify how to connect RTT ports up to ROS topics. The line of script to connect an RTT port to a ROS topic looks something like this:

stream("YourComponentName.YourRTTPortName", ros.topic("/topic_name")) 

Originally posted by jbohren with karma: 5809 on 2012-05-25

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by acp on 2012-05-28:
Hi, in advance thank you for your replay. Yea, I need a real time control, however I have some questions. 1.-) do i need to install a real time tool, for instance RTAI and then use this tool to create a rtt component? 2.-)what do you think about Boost?

Comment by acp on 2012-05-28:
Hi, in advance thank you for your replay. Yea, I need a real time control, however I have some questions.

Comment by acp on 2012-05-28:
I am a bit confuse, I have installed orocos_toolchain_ros which contain rtt_ros_integration, is that enough to create a rtt component?

Comment by jbohren on 2012-05-29:
If you need realtime control, then you need a kernel that supports some sort of realtime scheduling. If you don't have a realtime kernel, then any RTT components that you build will not have realtime precision.

Comment by acp on 2012-06-05:
http://www.orocos.org/wiki/orocos/ i recommend to read RTT wiki and toolchain and follow the examples in http://www.orocos.org/wiki/orocos/toolchain/getting-started/toolchain-tutorials (RTT 2.x Exercises). To get a good in site of rtt-components and real time processes

Comment by matheus.pinto on 2019-02-20:
what is the C++ equivalent of the script line you passed to link a port to the topic?

$\endgroup$
0
$\begingroup$

Rosanswers logo

For real time control tasks the most commonly used tool is Orocos. http://www.ros.org/wiki/orocos


Originally posted by Bence Magyar with karma: 358 on 2012-05-24

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by acp on 2012-05-24:
Thank you for the answer, but what I am missing is a simple code in real time using RTT where I can have a simple communication with the ports.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.