src
publishers
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
35
void
InfoPublisher::reset
(
ros::NodeHandle
& nh )
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
ros::NodeHandle::setParam
void setParam(const std::string &key, bool b) const
naoqi::publisher::BasicPublisher< naoqi_bridge_msgs::StringStamped >::topic_
std::string topic_
Definition:
publishers/basic.hpp:73
ros::NodeHandle::advertise
Publisher advertise(AdvertiseOptions &ops)
naoqi::publisher::BasicPublisher< naoqi_bridge_msgs::StringStamped >::pub_
ros::Publisher pub_
Definition:
publishers/basic.hpp:78
naoqi
Definition:
converter.hpp:29
naoqi::publisher::InfoPublisher::InfoPublisher
InfoPublisher(const std::string &topic, const robot::Robot &robot_type)
Definition:
publishers/info.cpp:29
naoqi::tools::getRobotDescription
std::string getRobotDescription(const robot::Robot &robot)
Definition:
robot_description.cpp:28
naoqi::robot::Robot
Robot
Definition:
tools.hpp:37
naoqi::publisher::InfoPublisher::reset
void reset(ros::NodeHandle &nh)
Definition:
publishers/info.cpp:35
naoqi::publisher::InfoPublisher::robot_
const robot::Robot & robot_
Definition:
publishers/info.hpp:51
naoqi::publisher::BasicPublisher
Definition:
publishers/basic.hpp:34
info.hpp
naoqi::publisher::BasicPublisher< naoqi_bridge_msgs::StringStamped >::is_initialized_
bool is_initialized_
Definition:
publishers/basic.hpp:75
ros::NodeHandle
naoqi_driver
Author(s): Karsten Knese
autogenerated on Sat Feb 3 2024 03:50:06