-
Notifications
You must be signed in to change notification settings - Fork 8
/
vel.cc
28 lines (19 loc) · 757 Bytes
/
vel.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
#include <gazebo/gazebo_config.h>
#include <gazebo/transport/transport.hh>
#include <gazebo/msgs/msgs.hh>
#include <gazebo/gazebo_client.hh>
#include <SetPIDParamRequest.pb.h>
int main(int argc, char **argv)
{
std::cerr << "GAZEBO_MAJOR_VERSION:" << GAZEBO_MAJOR_VERSION << std::endl;
gazebo::client::setup(argc, argv);
gazebo::transport::NodePtr node(new gazebo::transport::Node());
node->Init();
gazebo::transport::PublisherPtr pub = node->Advertise<gazebo_demos_proto::msgs::SetPIDParamRequest>("~/my_velodyne/set_pid_param");
pub->WaitForConnection();
gazebo_demos_proto::msgs::SetPIDParamRequest request;
request.set_pgain(0.01);
pub->Publish(request);
gazebo::client::shutdown();
}