Ask Your Question
1

Publishing diagnostics info with python on fuerte?

asked 2014-06-13 13:38:37 -0600

goshawk gravatar image

I have basically spent about two days to find a solution to this problem and figured that bringing this up here would be the best option. I am basically trying to publish diagnostics info on the /diagnostics topic using python nodes with fuerte. On the fuerte part of the wiki I see a link to a git repo. In the repo (1.7.0 branch) I see python api to use the diagnostics api but on my machine, even after updating, I cannot see the diagnostics api in python lib under /opt/ros/fuerte/lib (so I cannot do import diagnostic_updater). I am not sure how to add a lib from an online source but maybe there is an easier way.

I have nodes written in python but the current diagnostics_updater api is in c++. I am not sure how I can use a c++ stack to update the /diagnostics topic in python code. Perhaps I can use the diagnostics_msgs under /opt/ros/fuerte/lib which I can actually import in python. However I also do not know how.

If there is an easier way to publish on the diagnostics topic without messing with any class I can also do that so please share any insight or suggestions. (I just need basic robot info)

If anyone has done something like this and is willing to share a small tutorial I think you will add so much to the ROS community.

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-06-14 02:10:59 -0600

ahendrix gravatar image

updated 2014-06-16 17:29:07 -0600

EDIT

I just looked into this a little deeper and actually tried it out on one of my older machines. The last version of the diagnostics stack that was released into Fuerte was 1.6.4, which doesn't include the python API.

If you want to use the python API, you should either upgrade to Groovy or Hydro, which include it, or check out the 1.7.0 branch and use it from source with Fuerte.

ORIGINAL POST

In Fuerte, the diagnostics_updater is a rosbuild stack, so the python API is installed within the stack directory. You should be able to install it as part of the ros-fuerte-diagnostics package, and it should be installed into the package directory in /opt/ros/fuerte/stacks/diagnostics/diagnostic_updater/src/diagnostic_updater

If you want to use it from a python program in Fuerte, you'll have to make sure that your package manifest depends on diagnostic_updater, and make sure that you import roslib and call load_manifest.

For newer versions of ROS, the diagnostics packages are catkin packages and will be installed into /opt/ros/[distro]/lib .

edit flag offensive delete link more

Comments

I do not have a directory called diagnostic_updater in /opt/ros/fuerte/stacks/diagnotics/diagnostic_updater/src/ I tried updating it but it still doesn't work.

goshawk gravatar imagegoshawk ( 2014-06-16 17:01:55 -0600 )edit

It looks like I had a typo; can you try the corrected path? You can also inspect which files are installed by a package with dpkg -L; maybe try

dpkg -L ros-fuerte-diagnostics

ahendrix gravatar imageahendrix ( 2014-06-16 17:22:27 -0600 )edit

You shouldn't remove the diagnostics folder in /opt/ros/fuerte/stacks; having a copy of diagnostics in your workspace will override the system version. The diagnostics directory in /opt/ros/fuerte/stacks will also be recreated if the ros-fuerte-diagnostics package is updated or reinstalled.

ahendrix gravatar imageahendrix ( 2014-06-17 01:01:33 -0600 )edit

Also note that removing the diagnostics directory in /opt/ros/fuerte/stacks will break any installed packages that depend on the C++ diagnostics library, including most camera and laser drivers.

ahendrix gravatar imageahendrix ( 2014-06-17 01:02:37 -0600 )edit

I re-installed ros-fuerte and cloned diagnostics to my packages folder but ros still tries to get the diagnostics in /opt/ros/fuerte/stacks when I do roscd. Is this an issue with my bash file? (In my bash file, I export the package directory but don't tell it a new source for setup.bash)

goshawk gravatar imagegoshawk ( 2014-06-17 10:02:42 -0600 )edit

Never mind it randomly started to work. Thanks again

goshawk gravatar imagegoshawk ( 2014-06-17 14:55:32 -0600 )edit

Does this process change when I am trying to add these new packages in groovy? It turns out that we are using a source made groovy in our linaro. I tried just adding the folder to my packages directory and running catkin_make in the main directory. This doesn't work. Am I missing anything?

goshawk gravatar imagegoshawk ( 2014-06-21 21:25:59 -0600 )edit

The version of diagnostics that's released into Groovy should include the python API. If you're building from source you should use the version of diagnostics that is released for Groovy; probably not the 1.7.0 version that you were using with Fuerte.

ahendrix gravatar imageahendrix ( 2014-06-21 21:54:47 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-06-13 13:38:37 -0600

Seen: 238 times

Last updated: Jun 16 '14