Skip to content Skip to sidebar Skip to footer

I'm Trying To Publish A Message Of A Tizen Based App On Ros Using Rosbridge And I Get An Error

as the title says, I'm trying to publish a message on ros using rosbridge, because my app is written in javascript. Basically i want to cast a stream of heart rate data on a pc run

Solution 1:

If you are reading HRM data from Tizen wearable device you may use tizen.humanactivitymonitor of Human Activity Monitor API Instead of using window.webapis.motion

Rather using

window.webapis.motion.start("HRM", onchangedCB);

functiononchangedCB(hrmInfo) {
    var data = hrmInfo.heartRate;
    document.getElementById("mytext").innerHTML = 'Heart Rate= ' + data + ' bpm';
    ...
    ..
   }

You may try

var dataCount = 0;

functiononsuccessCB(hrmInfo)
{
   console.log("Heart Rate: " + hrmInfo.heartRate);
   console.log("Peak-to-peak interval: " + hrmInfo.rRInterval + " milliseconds");
   dataCount++;

   ...
   ..

   if (dataCount > 10){
       /* Stop the sensor after detecting a few changes */
       tizen.humanactivitymonitor.stop("HRM");
   }
}

tizen.humanactivitymonitor.start("HRM", onsuccessCB);

And add the necessary privileges in config.xml file

<tizen:privilegename="http://tizen.org/privilege/healthinfo"/><tizen:privilegename="http://tizen.org/privilege/power"/>

According to the Tizen API reference datatype of the heartRate is long.

Please Check the Tizen Human Activity Monitor Guide and Tizen API reference for details implementation.

Post a Comment for "I'm Trying To Publish A Message Of A Tizen Based App On Ros Using Rosbridge And I Get An Error"