publishers/info.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 /*
19 * LOCAL includes
20 */
21 #include "info.hpp"
22 #include "../tools/robot_description.hpp"
23 
24 namespace naoqi
25 {
26 namespace publisher
27 {
28 
29 InfoPublisher::InfoPublisher(const std::string& topic , const robot::Robot& robot_type)
30  : BasicPublisher( topic ),
31  robot_(robot_type)
32 {
33 }
34 
36 {
37  // We latch as we only publish once
38  pub_ = nh.advertise<naoqi_bridge_msgs::StringStamped>( topic_, 1, true );
39 
40  std::string robot_desc = naoqi::tools::getRobotDescription(robot_);
41  nh.setParam("/robot_description", robot_desc);
42  std::cout << "load robot description from file" << std::endl;
43 
44  is_initialized_ = true;
45 }
46 
47 } // publisher
48 } //naoqi
InfoPublisher(const std::string &topic, const robot::Robot &robot_type)
void reset(ros::NodeHandle &nh)
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const
std::string getRobotDescription(const robot::Robot &robot)


naoqi_driver
Author(s): Karsten Knese
autogenerated on Sat Feb 15 2020 03:24:26