ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to get rosjava generate classes instead of interfaces ?

asked 2014-02-25 08:38:39 -0500

psoetens gravatar image

updated 2014-02-25 08:39:18 -0500

Hi,

I followed the rosjava tutorials for 'unofficial messages' for Hydro. It all works, but I get an interface .java file instead of a class. For example:

scip_api/msgs/Alarm.msg:

string alarm_name
string data_name

scip_api/build/generated-src/scip_api/Alarm.java:

package scip_api;

public interface Alarm extends org.ros.internal.message.Message {
  static final java.lang.String _TYPE = "scip_api/Alarm";
  static final java.lang.String _DEFINITION = "string alarm_name\nstring data_name";
  java.lang.String getAlarmName();
  void setAlarmName(java.lang.String value);
  java.lang.String getDataName();
  void setDataName(java.lang.String value);
}

While for the std_msgs types, the generated .java file is a class (at least for String.msg it is)

What did I do wrong ? I used the released ros-hydro-rosjava packages for Ubuntu 12.04

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-25 09:04:30 -0500

psoetens gravatar image

The post above was confused by http://answers.ros.org/question/10276... which probably refers to an older version where this was possible.

The getting started guide of rosjava here: http://docs.rosjava.googlecode.com/hg...

explains how to instantiate messages using a factory. All messages are interfaces on purpose.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-02-25 08:38:39 -0500

Seen: 123 times

Last updated: Feb 25 '14