ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'm wondering; is there a config file for ROS Sensors Driver (http://wiki.ros.org/android_sensors_driver) to use with $ rosrun rviz riv -d <config_file> in order to plot (on a 2D graph e.g.) sensors' data from an Android device (smartphone)?

I'm not aware of such a config file existing. Not that I'm pretending to know everything, but because RViz is not a "plotting tool", but a 3D rendering environment that happens to know how to visualise ROS msgs that have a spatial aspect to them (ie: a TF frame or some other form of 3D / 6D data).

Plotting could be done using rqt_plot or plotjuggler.

I'm wondering; is there a config file for ROS Sensors Driver (http://wiki.ros.org/android_sensors_driver) to use with $ rosrun rviz riv -d <config_file> in order to plot (on a 2D graph e.g.) sensors' data from an Android device (smartphone)?

I'm not aware of such a config file existing. Not that I'm pretending to know everything, but because RViz is not a "plotting tool", but a 3D rendering environment that happens to know how to visualise ROS msgs that have a spatial aspect to them (ie: a TF frame or some other form of 3D / 6D data).

Plotting could be done using rqt_plot or plotjuggler.


Edit:

I have tried two other things in the meantime:
1) the imu plugin for rviz: http://wiki.ros.org/rviz_imu_plugin : worked like a charm, I'm receiving the /android/imu messages from the $ rosbag play <my_bag_file> command I launched in the same time (I'm now searching how to visualize the device motion relative to the map frame instead of it's own frame, which is giving it a "static look" except for rotations which are fine.

This may be semantics, but when you wrote "plotting", I understood you wanted to be able to visualise a time-varying signal in such a way that its values would be both visualised as well as inspectable at all times captured in your data. RViz does not support that, as it only renders the current state. The IMU plugin is nice, but it doesn't "plot".

2) rqt_bag: http://wiki.ros.org/rqt_bag : it seems also to work correctly to me but hasn't a graph visualization mode; rqt_bag screenshot

Try right clicking on one of the rows there. The context menu allows various operations to be performed on the message streams.

Then, I tried your python script to fix the bag file itself in two ways, none of them is working;

Just to clarify: the error message from PlotJuggler made me suspect that you may be running into the issue with rosjava msgs I linked to. I can't be certain.

As to the errors from rosbag_fixer: if you can provide (a short segment of) the bag file, I can take a look.

I'm wondering; is there a config file for ROS Sensors Driver (http://wiki.ros.org/android_sensors_driver) to use with $ rosrun rviz riv -d <config_file> in order to plot (on a 2D graph e.g.) sensors' data from an Android device (smartphone)?

I'm not aware of such a config file existing. Not that I'm pretending to know everything, but because RViz is not a "plotting tool", but a 3D rendering environment that happens to know how to visualise ROS msgs that have a spatial aspect to them (ie: a TF frame or some other form of 3D / 6D data).

Plotting could be done using rqt_plot or plotjuggler.


Edit:

I have tried two other things in the meantime:
1) the imu plugin for rviz: http://wiki.ros.org/rviz_imu_plugin : worked like a charm, I'm receiving the /android/imu messages from the $ rosbag play <my_bag_file> command I launched in the same time (I'm now searching how to visualize the device motion relative to the map frame instead of it's own frame, which is giving it a "static look" except for rotations which are fine.

This may be semantics, but when you wrote "plotting", I understood you wanted to be able to visualise a time-varying signal in such a way that its values would be both visualised as well as inspectable at all times captured in your data. RViz does not support that, as it only renders the current state. The IMU plugin is nice, but it doesn't "plot".

2) rqt_bag: http://wiki.ros.org/rqt_bag : it seems also to work correctly to me but hasn't a graph visualization mode; rqt_bag screenshot

Try right clicking on one of the rows there. The context menu allows various operations to be performed on the message streams.

Then, I tried your python script to fix the bag file itself in two ways, none of them is working;

Just to clarify: the error message from PlotJuggler made me suspect that you may be running into the issue with rosjava msgs I linked to. I can't be certain.

As to the errors from rosbag_fixer: if you can provide (a short segment of) the bag file, I can take a look.


Edit 2:

Ok for having append my own answer to the first post, even if it may be more difficult to "follow a discussion" in the future as it becomes more and more detailed.

true, but at least we keep the chronological ordering of interactions. ROS Answers is a Q&A type site, which works best if there is (almost) a 1-to-1 ratio of questions and answers. It's fine to post answers yourself, but they should then actually answer the question, not be updates with additional information or progress.

If you'd like, you could put the most recent edit at the top instead of at the bottom of your post.

I also wasn't able to read a bagfile with the python API ( http://wiki.ros.org/rosbag/Code%20API#cpp_api ), running the same kind of error as described here e.g.: https://github.com/jacknlliu/development-issues/issues/39.

That would seem to point to the problem described in rosjava/rosjava_bootstrap#16, which is what rosbag_fixer was created to work around.

So, it seems related to rosjava but I'm not sure either. I'm wondering why it hasn't been fixed yet, github issues about that are not recent (??).

The issue may be old (in fact, I believe this issue has always existed in rosjava), but so far hasn't been annoying enough to rosjava users for them to come up with a fix. As @jubeira writes in rosjava/rosjava_bootstrap#16, rosjava is mostly dependent on community contributions these days, so until someone steps up and fixes it, the problem is going to stay around.

For testing, here is also a bag of 17 seconds, it's a 745K file.

Thanks. I'll see if I can take a look. It does appear rosbag_fixer does something to the file after attempting to "fix" it which rosbag doesn't like. That doesn't surprise me, as rosbag_fixer is doing all sorts of nasty things it isn't supposed to.

I'm wondering; is there a config file for ROS Sensors Driver (http://wiki.ros.org/android_sensors_driver) to use with $ rosrun rviz riv -d <config_file> in order to plot (on a 2D graph e.g.) sensors' data from an Android device (smartphone)?

I'm not aware of such a config file existing. Not that I'm pretending to know everything, but because RViz is not a "plotting tool", but a 3D rendering environment that happens to know how to visualise ROS msgs that have a spatial aspect to them (ie: a TF frame or some other form of 3D / 6D data).

Plotting could be done using rqt_plot or plotjuggler.


Edit:

I have tried two other things in the meantime:
1) the imu plugin for rviz: http://wiki.ros.org/rviz_imu_plugin : worked like a charm, I'm receiving the /android/imu messages from the $ rosbag play <my_bag_file> command I launched in the same time (I'm now searching how to visualize the device motion relative to the map frame instead of it's own frame, which is giving it a "static look" except for rotations which are fine.

This may be semantics, but when you wrote "plotting", I understood you wanted to be able to visualise a time-varying signal in such a way that its values would be both visualised as well as inspectable at all times captured in your data. RViz does not support that, as it only renders the current state. The IMU plugin is nice, but it doesn't "plot".

2) rqt_bag: http://wiki.ros.org/rqt_bag : it seems also to work correctly to me but hasn't a graph visualization mode; rqt_bag screenshot

Try right clicking on one of the rows there. The context menu allows various operations to be performed on the message streams.

Then, I tried your python script to fix the bag file itself in two ways, none of them is working;

Just to clarify: the error message from PlotJuggler made me suspect that you may be running into the issue with rosjava msgs I linked to. I can't be certain.

As to the errors from rosbag_fixer: if you can provide (a short segment of) the bag file, I can take a look.


Edit 2:

Ok for having append my own answer to the first post, even if it may be more difficult to "follow a discussion" in the future as it becomes more and more detailed.

true, but at least we keep the chronological ordering of interactions. ROS Answers is a Q&A type site, which works best if there is (almost) a 1-to-1 ratio of questions and answers. It's fine to post answers yourself, but they should then actually answer the question, not be updates with additional information or progress.

If you'd like, you could put the most recent edit at the top instead of at the bottom of your post.

I also wasn't able to read a bagfile with the python API ( http://wiki.ros.org/rosbag/Code%20API#cpp_api ), running the same kind of error as described here e.g.: https://github.com/jacknlliu/development-issues/issues/39.

That would seem to point to the problem described in rosjava/rosjava_bootstrap#16, which is what rosbag_fixer was created to work around.

So, it seems related to rosjava but I'm not sure either. I'm wondering why it hasn't been fixed yet, github issues about that are not recent (??).

The issue may be old (in fact, I believe this issue has always existed in rosjava), but so far hasn't been annoying enough to rosjava users for them to come up with a fix. As @jubeira writes in rosjava/rosjava_bootstrap#16, rosjava is mostly dependent on community contributions these days, so until someone steps up and fixes it, the problem is going to stay around.

For testing, here is also a bag of 17 seconds, it's a 745K file.

Thanks. I'll see if I can take a look. It does appear rosbag_fixer does something to the file after attempting to "fix" it which rosbag doesn't like. That doesn't surprise me, as rosbag_fixer is doing all sorts of nasty things it isn't supposed to.


Edit 3: I've just "fixed" rosbag_fixer. Turned out the previous version didn't close the bag it was writing properly, which caused loss of data (specifically the index, which contains information on connections and topic types). Commit 3a4ff389 fixes that.

I've just ran all your test bags through the script and can load all of them in PlotJuggler and rosbag play them.

This is obviously not a solution to rosjava/rosjava_bootstrap#16, but at least the work-around works again.