ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
To add on to the above answer. You can enter the following into a c++ script. In my example I wanted to call a service and set a bool periodically to true
ros::ServiceClient example_srv; std_srvs::SetBool example_boolean_value = std_srvs::SetBool(); example_boolean_value.request.data = true; user_input_srv.call(example_boolean_value);
2 | No.2 Revision |
To add on to the above answer. You can enter the following into a c++ script. In my example I wanted to call a service and set a bool periodically to true
ros::ServiceClient example_srv;
std_srvs::SetBool example_boolean_value = std_srvs::SetBool();
example_boolean_value.request.data = true;
user_input_srv.call(example_boolean_value); user_input_srv.call(example_boolean_value);
3 | No.3 Revision |
To add on to the above answer. You can enter the following into a c++ script. In my example I wanted to call a service and set a bool periodically to true
ros::ServiceClient example_srv;
example_srv;
std_srvs::SetBool example_boolean_value = std_srvs::SetBool();
std_srvs::SetBool();
example_boolean_value.request.data = true;
true;
user_input_srv.call(example_boolean_value);
4 | No.4 Revision |
To add on to the above answer. You can enter the following into a c++ script. In my example I wanted to call a service and set a bool periodically to true
#include 5 | No.5 Revision |
To add on to the above answer. You can enter the following into a c++ script. In my example I wanted to call a service and set a bool periodically to true
#include "ros/service_client.h"
#include "ros/ros.h"
#include "std_srvs/SetBool.h
"std_srvs/SetBool.h"
ros::ServiceClient example_srv;
std_srvs::SetBool example_boolean_value = std_srvs::SetBool();
example_boolean_value.request.data = true;
example_srv.call(example_boolean_value);
6 | No.6 Revision |
To add on to the above answer. You can enter the following into a c++ script. In my example I wanted to call a service and set a bool periodically to true
#include "ros/service_client.h"
#include "ros/ros.h"
#include "std_srvs/SetBool.h"
ros::ServiceClient example_srv;
std_srvs::SetBool example_boolean_value = std_srvs::SetBool();
example_boolean_value;
example_boolean_value.request.data = true;
example_srv.call(example_boolean_value);