Get "Real Time" in OpenRTM controller / Keyboard input teleop module?

2 posts / 0 new
Last post
DavidB
Offline
Last seen: 10 years 8 months ago
Joined: 2013-08-15 23:21
Get "Real Time" in OpenRTM controller / Keyboard input teleop module?

Hi all (みなさん、こんにちは)

Sorry I post one of these questions in OpenHRP BBS. I am using OpenHRP3 for robot simulation, with a controller module from OpenRTM.

.

I can read the "Sim Time" of a message using:

    // Read data from port
    if (m_angleIn.isNew())
    {
        m_angleIn.read();
    }
    std::cout << "TimeStamp: " << m_angle.tm.sec << "  " << m_angle.tm.nsec << std::endl;

How can I get the "Real Time" time from the OpenHRP simulator please?

.

.

I would like to control robot simulation using keyboard input (tele-operation).

e.g. in terminal or GUI I pressed <enter> or <f> or <b>

How can I create a OpenRTM module or OpenHRP plugin that receives terminal keyboard input?

.

Thank you for your help (どうも ありがとう ございます).

Undefined
Ando Noriaki
Offline
Last seen: 1 year 9 months ago
Joined: 2011-09-04 17:20
[openrtm-users 02873] Get "Real Time" in OpenRTM controller / K

Hello,

2013/8/15 :
> Hi all (みなさん、こんにちは)
>
> Sorry I post one of these questions in OpenHRP BBS.
> I am using OpenHRP3 for robot simulation, with a controller
> module from OpenRTM. . I can read the "Sim Time" of a message using:
>
> // Read data from port
> if (m_angleIn.isNew()) {
> m_angleIn.read();
> }
> std::cout << "TimeStamp: " << m_angle.tm.sec << " " << m_angle.tm.nsec << std::endl;
>
> * How can I get the "Real Time" time from the OpenHRP simulator please?

If the "Real Time" means system time of the machine, you can use
coil::gettimeofday()
function. It has microseconds resolution and returns real time of the
system clock.
But this assumes that the target machine and the RTC which obtains the
real time are same.

> I would like to control robot simulation using keyboard input (tele-operation).
> e.g. in terminal or GUI I pressed or or
>
> * How can I create a OpenRTM module or OpenHRP plugin that receives terminal keyboard input?

If the RTC has STDIN and console, you can use ncurses library. But you
might want to receive
keyboard input from OpenHRP3's eclipse window. In that case, you may
have to catch keyboard
event through SWT (Standard Widget Toolkit) which is base GUI widget
library of Eclipse.

In typical OpenRTM way, you might add an InPort to the target RTC to
received keyboard
command or reference value, and connect an keyboard input RTC or joystick RTC.

> Thank you for your help (どうも ありがとう ございます).

Best regards,
Noriaki Ando
_______________________________________________
openrtm-users mailing list
openrtm-users@openrtm.org
http://www.openrtm.org/mailman/listinfo/openrtm-users

Log in or register to post comments

Download

latest Releases : 2.0.0-RELESE

2.0.0-RELESE Download page

Number of Projects

Choreonoid

Motion editor/Dynamics simulator

OpenHRP3

Dynamics simulator

OpenRTP

Integrated Development Platform

AIST RTC collection

RT-Components collection by AIST

TORK

Tokyo Opensource Robotics Association

DAQ-Middleware

Middleware for DAQ (Data Aquisition) by KEK