[ros-users] rospkg API review (REP 114)

Ken Conley kwc at willowgarage.com
Tue Oct 4 20:23:53 UTC 2011


On Tue, Oct 4, 2011 at 5:48 AM, Dirk Thomas <mail at dirk-thomas.net> wrote:
> Hi Ken,
>
> we are using rospkg for ROS GUI.
>
> There was only one thing which was inconvenient to use.
> We had to manually replace "${prefix}" from the plugin-attribute of an
> export tag.
> See the following code snippet:
>
>    plugins = []
>    r = rospkg.RosPack()
>    for package_name in r.list():
>        manifest = r.get_manifest(package_name)
>        package_path = r.get_path(package_name)
>        exports = manifest.get_export(self.export_tag_, 'plugin')
>        for export in exports:
>            xml_file_name = str(export)
> =>          xml_file_name = xml_file_name.replace('${prefix}', package_path)
>            plugins.append([package_name, xml_file_name])
>
> Would it be possible to hide this from the user and perform the replacement
> transparently (if desired in all cases)?

Good suggestion.  As this is the behavior of rospack, I changed rospkg
to match it by default.  You can get the raw export by adding a
"convert=False" arg to the get_export() call instead.

> A minor cosmetic issue is the printing of "READ_CACHE manifest.xml" in
> rospkg/rospack.py:188.
> I guest this output will be removed in the next release?

Yes, this has already been removed.  I pushed 0.2.3 with the fix as
well as updated get_export() API.

thanks,
Ken

>
> Dirk
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>



More information about the ros-users mailing list