ROSJAVA and External Libraries (again)
Dear all,
I try to include an external library to the example of rosjava_tutorial_pubsub_Listener.
I modified the code as follows:
package org.ros.tutorials.pubsub;
import org.apache.commons.logging.Log;
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
import org.ros.node.Node;
import org.ros.node.NodeMain;
import org.ros.node.topic.Subscriber;
import cylinder_reasoner.*;
/**
* This is a simple rosjava {@link Subscriber} {@link Node}. It assumes an
* external roscore is already running.
*
* @author damonkohler@google.com (Damon Kohler)
*/
public class Listener implements NodeMain {
@Override
public GraphName getDefaultNodeName() {
return new GraphName("rosjava_tutorial_pubsub/listener");
}
@Override
public void onStart(Node node) {
final Log log = node.getLog();
CylinderReasoner reasoner=new CylinderReasoner();
reasoner.doReasoning("//home//eich//Cylinders.txt");
Subscriber<org.ros.message.std_msgs.String> subscriber =
node.newSubscriber("chatter", "std_msgs/String");
subscriber.addMessageListener(new MessageListener<org.ros.message.std_msgs.String>()
{
@Override
public void onNewMessage(org.ros.message.std_msgs.String message) {
log.info("I heard: \"" + message.data + "\"");
}
});
}`
Than I added the following line to the manifest.txt
<rosjava-pathelement location="/home/eich/Test.jar" />
Test Test.jar contains the Package cylinder_reasoner.CylinderReasoner.
Problem is I cannot compile. The error is that
Listener.java:25: package cylinder_reasoner does not exist
Do I have to set the jar file somewhere else as well? Or only in the manifest. After calling rosmake, the .classpath is updated correctly, but it cannot find the package.
Do you have any ideas?
Thank you