0
$\begingroup$

Rosanswers logo

HI,

i want to display something published in a custom Message on my android device

I get the error:

E/scriberHandshakeHandler﹕ Subscriber handshake failed: Message types don't match.

i had some troubles setting up my textview

rosTextView_speed = (RosTextView_speed<vehicle_model_dynamics>) findViewById(R.id.TextView01);
    rosTextView_speed.setTopicName("veh_vehicle_model_dynamics");
    //public void setMessageType(String messageType) {
    //    this.messageType = messageType;
    //}
    rosTextView_speed.setMessageType(vehicle_model_dynamics._TYPE);
    // T = Return Type
    //public void setMessageToStringCallable(MessageCallable<String, T> callable) {
    //    this.callable = callable;
    //}
    rosTextView_speed.setMessageToStringCallable(new MessageCallable<String, vehicle_model_dynamics>() {
        //Überschreiben der Methode Call in MessageCallable
        // RÜCKGABETYP call (MESSAGETYP)
        //public interface MessageCallable<T, S> {
        //    T call(S message);
        //}
        @Override
        public String call(vehicle_model_dynamics message) {
            //velocity = message.getData();
            Log.v("DEBUG:", "Speed Message Callable");
            return String.valueOf(message.getVelocity());
        }
    });

in rqt i am publishing topic: veh_vehicle_model_dynamics type: ros_messages/vehicle_model_dynamics the velocity value 111 (float64)

i also imported my custom messages

vehicle_model_dynamics.class in custom_msgs-0.0.0.jar

  // IntelliJ API Decompiler stub source generated from a class file
  // Implementation of methods is not available

package custom_msgs;

public interface vehicle_model_dynamics extends org.ros.internal.message.Message {
java.lang.String _TYPE = "custom_msgs/vehicle_model_dynamics";
java.lang.String _DEFINITION = "####################################################\n
#\n# Vehicle Model     Dynamic Information\n#\n# ...\n#\n
# Description: n#\n####################################################\n\n
# ROS Header\nHeader header
\n\n
# Data
\n
qualified_timed_float64 velocity # [m/s] vehicle velocity
\n\n
qualified_timed_float64 acceleration_x                      # [m/s^2] vehicle acceleration X
\n\n
qualified_timed_float64 acceleration_y                      # [m/s^2] 

...

    std_msgs.Header getHeader();

    void setHeader(std_msgs.Header header);

    custom_msgs.qualified_timed_float64 getVelocity();

    void setVelocity(custom_msgs.qualified_timed_float64 qualified_timed_float64);

    custom_msgs.qualified_timed_float64 getAccelerationX();

    void setAccelerationX(custom_msgs.qualified_timed_float64 qualified_timed_float64);

    ...
}

any guesses what is wrong?

Thanks


rosnode info /play_rosbag:

Node [/play_rosbag]
Publications: 
  * /veh_vehicle_model_dynamics [ros_messages/vehicle_model_dynamics]
  * /function_drivinggoal_desired [ros_messages/function_drivinggoal]

contacting node http://192.168.0.95:37820/ ...
Pid: 4151
Connections:
* topic: /rosout
* to: /rosout
* direction: outbound
* transport: TCPROS

...

Connection to /android_gingerbread/ros_text_view_speed_limited missing
Connection to /android_gingerbread/ros_text_view_speed missing

rosnode info /android_gingerbread/ros_text_view_speed_limited:

Subscriptions: 
 * /function_drivinggoal_desired [ros_messages/function_drivinggoal]

contacting node http://192.168.0.199:44133/ ...
Pid: 2328
Connections:
* topic: /rosout
* to: /rosout
* direction: outbound
* transport: TCPROS
* topic: /function_drivinggoal_desired
* to: /play_1408345524838586534 (http://192.168.0.95:37820/)
* direction: inbound
* transport: TCPROS

rosnode info /android_gingerbread/ros_text_view_speed:

Subscriptions: 
* /veh_vehicle_model_dynamics [ros_messages/vehicle_model_dynamics]

contacting node http://192.168.0.199:48483/ ...
Pid: 2744
Connections:
* topic: /rosout
* to: /rosout
* direction: outbound
* transport: TCPROS
* topic: /veh_vehicle_model_dynamics
* to: /play_1408345524838586534 (http://192.168.0.95:37820/)
* direction: inbound
* transport: TCPROS

could the error come from the name of my custom_msgs

could rebuilding the jar as "ros_messages" solve the problem?


Originally posted by stefan on ROS Answers with karma: 15 on 2014-08-14

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

You shouldn't have to fiddle around with jars, are you following the tutorial to make a special rosjava message project standin?

http://wiki.ros.org/rosjava/Tutorials/hydro/Unofficial%20Messages

and

http://wiki.ros.org/rosjava_build_tools/Tutorials/hydro/Creating%20Android%20Packages


Originally posted by paulbovbel with karma: 4518 on 2014-08-18

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

renaming my jar into ros_messages did it

so you should always name your rosjava_msg_projects like the folders your messages are organized in!


Originally posted by stefan with karma: 15 on 2014-08-18

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.