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

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.request.data = true; user_input_srv.call(example_boolean_value);

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/service_client.h"

include <ros ros.h="">

#include "ros/ros.h"

include <std_srvs setbool.h="">

#include "std_srvs/SetBool.h"

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);

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; 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);

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"

"ros/service_client.h" #include "ros/ros.h" #include "std_srvs/SetBool.h

#include "ros/ros.h"

#include "std_srvs/SetBool.h"

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; example_srv.call(example_boolean_value);
user_input_srv.call(example_boolean_value);

click to hide/show revision 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);

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);