[ros-users] ROSjava and non-standard messages

Ken Conley kwc at willowgarage.com
Mon Aug 15 17:07:31 UTC 2011


On Mon, Aug 15, 2011 at 10:00 AM, Mark Rowan <m.s.rowan at cs.bham.ac.uk> wrote:
> Hi Ken,
>
> On 15 August 2011 17:36, Ken Conley <kwc at willowgarage.com> wrote:
>> On Mon, Aug 15, 2011 at 6:27 AM, Mark Rowan <m.s.rowan at cs.bham.ac.uk> wrote:
>>> 1). How do I obtain / compile the remaining message types, e.g.
>>> nav_msgs, so they can be added to my ROSjava code?
>>
>> Per above, you declare a dependency on nav_msgs and you also have to
>> run rosmake.
>
> Thanks. I see how it works now -- very neat.
>
>>> 2). Does this now mean that I *have* to use rosmake (including making
>>> required changes to the manifest file, etc) on my Java code?
>>> Previously I was quite happy editing code, compiling it using javac,
>>> and running it using "rosrun rosjava <package>.<class>" on the command
>>> line.
>>
>> http://www.ros.org/wiki/rosjava/Overview/Build#Building_your_ROS_package
>>
>> "After you have run rosmake my_pkg, you can use ant to do subsequent
>> builds that are much quicker."
>>
>> ... you can also do whatever you wish by hand, though using ant is a
>> lot easier that running javac.
>
> Ok, I've got ant working (thanks to the supplied build.xml on the
> rosjava wiki page you linked to, although there was a small error in
> the XML file which I've corrected on the wiki) but I can't seem to
> find any way to run the compiled classes using rosrun. Is this
> possible, or do we have to manually execute nodes using java
> -classpath <path> package.class ?

This is still be tweaked and documentation hasn't been written yet,
but you can use:

"
rosrun rosjava_bootstrap run.py <pkg> <node_class>  [args ... ]
"

That script generally assumes that you are using the <export> tags to
setup your path.  These <export> tags are currently being finalized
and you'd have to look at rosjava_core packages for examples.

But, the script basically constructs the path from the export tags and runs:

java -classpath <classpath> org.ros.RosRun <node_class> [args...]

So that should be fairly similar to what you are used to.

 - Ken

> Thanks again,
>
> Mark
>
> --
> Mark Rowan  |  http://www.tamias.co.uk
> _______________________________________________
> 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