Skip to content

rosserial_python : Service handler returned None #408

@michalrom089

Description

@michalrom089

I've setup service server on stm32 :

ros::NodeHandle nh;

void srv_callback(const custom_srv::AddTwoIntsRequest &req, custom_srv::AddTwoIntsResponse &res){
	res.Sum = 2;
}

ros::ServiceServer<custom_srv::AddTwoIntsRequest,custom_srv::AddTwoIntsResponse> server("add_two_ints",&srv_callback);

void setup(){
	nh.initNode();
	nh.advertiseService(server);
}
void loop(void)
{
	nh.spinOnce();
}

But when I try to call the service from rosserial_python error occurs :

$rosservice call /add_two_ints "A: 0
B: 0" 
ERROR: service [/add_two_ints] responded with an error: service cannot process request: service handler returned None

I tried to debug this error on stm32. Apparently, the error occurs befor computing srv_callback(). I assume that this is related with rosserial_python package but it's onyl guessing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions