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

Revision history [back]

click to hide/show revision 1
initial version

After adding return true; to my bool callback, it works now. Whole example function (obviously my function is way bigger):

bool calcuCallback(beginner_tutorials::AddTwoInts::Request &req,
                    beginner_tutorials::AddTwoInts::Response &res)
{
    res.sum = req.a + req.b;
    return true; // this was needed
}

Any idea when the return true; statement is needed and when it is not? When someone knows it, he can give the whole answer so I can mark it. Thanks Felix for setting me on track.

After adding return true; to my bool callback, it works now. Whole example function (obviously my function is way bigger):

bool calcuCallback(beginner_tutorials::AddTwoInts::Request &req,
                    beginner_tutorials::AddTwoInts::Response &res)
{
    res.sum = req.a + req.b;
    return true; // this was needed
}

Any idea when the return true; statement is needed and when it is not? not (or if it is just a workaround for another depper issue)? When someone knows it, he can give the whole answer so I can mark it. Thanks Felix for setting me on track.

After adding return true; to my bool callback, it works now. Whole example function (obviously my function is way bigger):

bool calcuCallback(beginner_tutorials::AddTwoInts::Request &req,
                    beginner_tutorials::AddTwoInts::Response &res)
{
    res.sum = req.a + req.b;
    return true; // this was needed
}

Any idea when the return true; statement is needed and when it is not (or if it is just a workaround for another depper deeper issue)? When someone knows it, he can give the whole answer so I can mark it. Thanks Felix for setting me on track.