8 #include <geographic_msgs/GeoPose.h> 9 #include <robot_localization/SetDatum.h> 12 #include <GeographicLib/GeoCoords.hpp> 21 int main(
int argc,
char **argv)
23 ros::init(argc, argv,
"set_datum_client");
26 robot_localization::SetDatum srv;
28 double latitude0_param, longitude0_param, altitude0_param, convergence0_param;
36 ROS_INFO(
"Using params from .yaml ");
37 ROS_INFO(
"latitude0_deg [%f] longitude0_deg [%f] altitude0 [%f]", latitude0_param, longitude0_param, altitude0_param);
41 geographic_msgs::GeoPose geo_pose;
42 geo_pose.position.latitude = latitude0_param;
43 geo_pose.position.longitude = longitude0_param;
44 geo_pose.position.altitude = altitude0_param;
46 GeoCoords conversion_data(latitude0_param, longitude0_param);
47 float convergence_radians = conversion_data.Convergence() *
M_PI/180.0;
49 ROS_INFO(
"convergence [%f] ", convergence_radians);
52 srv.request.geo_pose = geo_pose;
58 ROS_ERROR(
"Failed to call datum service");
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
int main(int argc, char **argv)
Client Node. Takes localization parameters to set orogin of map.
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
bool call(MReq &req, MRes &res)
ROSCPP_DECL bool get(const std::string &key, std::string &s)
ROSCPP_DECL bool has(const std::string &key)
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)