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

ROS Android Server - ERROR: Unable to load type [closed]

asked 2014-05-06 06:45:20 -0600

thomasL gravatar image

updated 2014-05-07 12:09:48 -0600

Hi everyone,

1) I didn't succeed in creating a ServiceServer on Android ROS node.

rosservice call /Robot1/waypoint_srv std_msgs/bool 'true'
ERROR: Unable to load type [std_msgs/Bool].
Have you typed 'make' in [std_msgs]?

Here is the code for the Server (the name of the Robot is "Robot1":

private ServiceServer<Bool, Bool> server_waypoints;

    this.server_waypoints=node.newServiceServer(mainActivity.getRobotName()+"/waypoint_srv", "std_msgs/Bool", new ServiceResponseBuilder<Bool, Bool>() {
        @Override
        public void build(Bool bool1, Bool bool) throws ServiceException {
            bool.setData(true);
        }
    });

--> ROS seems to be not able to match "std_msgs/Bool" from Android with Ubuntu one. "Service Caller" in rqt is not able to find what kind of message it has to send.

ServiceCaller.on_refresh_services_button_clicked(): could not get class of service /Robot1/waypoint_srv

2) The next step is to create my own message for the request (waypoint for the robot). Do I have to generate a .msg or a .srv for Android Studio (I guess it is a .msg) and would it be compatible with a C++ node client?

Thank you very much

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-05-07 02:33:17 -0600

thomasL gravatar image

1) The matter is that "std_msgs/Bool" is an identifier for msg and not srv. I generate a custom srv and replace by "my_custom_service._TYPE"

2) rosjava won't generate a new .jar file for msg & srv if one exist already : you have to delete the whole folder "build" each time you want to add a new message or service. I followed this way to generate new msg/srv Unofficial Messages

edit flag offensive delete link more

Comments

new ServiceServer<my_custom_servicerequest, my_custom_serviceresponse=""> ros java generate my_custom_serviceRequest.class, my_custom_serviceResponse.class & my_custom_service.class

thomasL gravatar image thomasL  ( 2014-05-07 02:40:42 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-05-06 06:45:20 -0600

Seen: 2,375 times

Last updated: May 07 '14