How to publish diagnostic data of my robot hardware

Typically: "How do I... ", "How can I... " questions
Post Reply
ssj
Posts: 27
Joined: 27 Feb 2017, 15:40

How to publish diagnostic data of my robot hardware

Post by ssj » 11 May 2018, 16:24

Hey
I have developed a robot in vrep that has two rotatory joints for motors, 8-force sensors and a laser scanner for mapping. I want to collect information from robot hardware for analysis, troubleshooting, and logging using ROS diagnostics stack that contains tools for collecting, publishing, analyzing and viewing diagnostics data. How can I configure my robot in vrep with the ROS packages for publishing diagnostics? Or is there any other way to monitor the status (OK, ERROR, WARNING)of hardware devices in VREP that is also compatible with ROS?? Please help..

coppelia
Site Admin
Posts: 6559
Joined: 14 Dec 2012, 00:25

Re: How to publish diagnostic data of my robot hardware

Post by coppelia » 15 May 2018, 08:21

Hello,

you will have to interface those messages with a script, in the exact same way as you would communicate between ROS and V-REP via the RosInterface. Is your model already communicating with ROS?

Cheers

ssj
Posts: 27
Joined: 27 Feb 2017, 15:40

Re: How to publish diagnostic data of my robot hardware

Post by ssj » 16 May 2018, 05:13

Hey Coppelia

Thanks for your response.
Yes, my robot in vrep is already communicating with ROS. But I m unable to collect diagnostic data of my robot components like joint, hokuyo..
what messages are you talking about, please explain..
can you give me some example like the procedure to get the status of a joint using ROS diagnostic_updater so that I can have idea and do the rest myself?

fferri
Posts: 149
Joined: 09 Sep 2013, 19:28

Re: How to publish diagnostic data of my robot hardware

Post by fferri » 18 May 2018, 14:10

You can send and receive any ROS message with the RosInterface plugin.

Any kind of message is sent and received in the same way. You would need a publisher if you want to broadcast data, and a subscriber if you want to receive data.

Lookup the message definition on the web, or on your system, and create it in a Lua table.

For example for creating a DiagnosticArray message, you would do:

Code: Select all

msg = {
    header = {
        stamp = sim.getSimulationTime(),
        frame_id = 'set this value appropriately'
    },
    status = {
        {level=0, name='...', message='...', hardware_id='...', values={...}},
        {...},
        {...}
    }
}

Post Reply