Ask Your Question
0

How to compile and run rosjava Hello World

asked 2012-09-12 06:14:08 -0600

LargeBearCat gravatar image

Ok, rosjava_core is build.

Now I moved to the Hello World tutorial "http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html".

I used the gradlew wrapper and copy pasted the gradle folder into my package folder because otherwise it would not even slightly work. The build error said that certain classes/symbols could not be resolved from the Hello World Code.

But before I even start spewing out the error messages, I first want to ask a much simpler question: In the sense of the tutorial (http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html), am I supposed to create my test package inside the rosjava_core folder or am I allowed to set it up anywhere in /home?

Thanks for the answer!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2012-09-13 00:14:26 -0600

LargeBearCat gravatar image

updated 2012-09-24 04:57:55 -0600

gradle install approach still does not work, but compilation now works with copy-paste gradlew. I had the gradle configuration files inside the package folder instead of outside.

Edit:

Nope, still problems :-). Forget what I wrote before.

I can build the example packages in the rosjava_core folder as described in (http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html).

What I did next was copy pasting the example package "rosjava_tutorial_pubsub" and renaming the package to "rosjava_testPackage" as a test. In the folder rosjava_testPackage I renamed everything accordingly. But now ../gradlew installApp yields the errors:


FAILURE: Build failed with an exception.

* Where:
Build file '/home/userName/ros_workspace/rosjava_core/rosjava_testPackage/build.gradle'
line: 22

* What went wrong:
A problem occurred evaluating root project 'rosjava_testPackage'.
Project with path ':rosjava' could not be found in root project 'rosjava_testPackage'.

* Try:
Run with --stacktrace option to get the stack trace. 
Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.834 secs

I used the same gradlebuild file as in the example package "rosjava_tutorial_pubsub", which looks like this:


/* .... */

apply plugin: 'application'

mainClassName = 'org.ros.RosRun'

dependencies {
  compile project(':rosjava')
}

Line 22 refers to "compile project(':rosjava')".

How can there be errors if the test package is a renamed copy of the tutorial package?

Edit 2: Problem solved. I had to manually register the package in gradle settings.

edit flag offensive delete link more
0

answered 2012-09-12 23:20:43 -0600

MarkyMark2012 gravatar image

So long as your paths etc are set up you should be able to set up the package where ever you like

edit flag offensive delete link more

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: 2012-09-12 06:14:08 -0600

Seen: 1,017 times

Last updated: Sep 24 '12