diff --git a/rosserial_client/src/ros_lib/ros/node_handle.h b/rosserial_client/src/ros_lib/ros/node_handle.h index 1db13bce4..8fa27b19b 100644 --- a/rosserial_client/src/ros_lib/ros/node_handle.h +++ b/rosserial_client/src/ros_lib/ros/node_handle.h @@ -661,6 +661,24 @@ class NodeHandle_ : public NodeHandleBase_ } return false; } + bool getParam(const char* name, bool* param, int length = 1, int timeout = 1000) + { + if (requestParam(name, timeout)) + { + if (length == req_param_resp.ints_length) + { + //copy it over + for (int i = 0; i < length; i++) + param[i] = req_param_resp.ints[i]; + return true; + } + else + { + logwarn("Failed to get param: length mismatch"); + } + } + return false; + } }; } diff --git a/rosserial_python/src/rosserial_python/SerialClient.py b/rosserial_python/src/rosserial_python/SerialClient.py index aa98cd188..858745cbf 100644 --- a/rosserial_python/src/rosserial_python/SerialClient.py +++ b/rosserial_python/src/rosserial_python/SerialClient.py @@ -670,7 +670,7 @@ def handleParameterRequest(self, data): if t!= type(p): rospy.logerr('All Paramers in the list %s must be of the same type'%req.name) return - if (t == int): + if (t == int or t == bool): resp.ints= param if (t == float): resp.floats=param