Skip to content

Commit e0b6778

Browse files
author
Daisuke Nishimatsu
committed
add win patch
Signed-off-by: Daisuke Nishimatsu <nishimarudai@gmail.com>
1 parent 368d8b3 commit e0b6778

1 file changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
diff --git a/server/src/parameter_server.cpp b/server/src/parameter_server.cpp
2+
index 210a80a..458ae21 100644
3+
--- a/server/src/parameter_server.cpp
4+
+++ b/server/src/parameter_server.cpp
5+
@@ -30,6 +30,12 @@
6+
#define PERSISTENT_KEY "persistent"
7+
#define PERSISTENT_DOT_KEY "persistent."
8+
9+
+#if defined(_MSC_VER)
10+
+#define PARAMETER_SERVER_FUNCTION __FUNCSIG__
11+
+#else
12+
+#define PARAMETER_SERVER_FUNCTION __PRETTY_FUNCTION__
13+
+#endif
14+
+
15+
/**
16+
* @brief Converts a double to string with proper floating-point representation.
17+
*
18+
@@ -65,7 +71,7 @@ ParameterServer::ParameterServer(
19+
persistent_yaml_file_(persistent_yaml_file),
20+
node_name_(get_name())
21+
{
22+
- RCLCPP_DEBUG(this->get_logger(), "%s yaml:%s", __PRETTY_FUNCTION__, persistent_yaml_file_.c_str());
23+
+ RCLCPP_DEBUG(this->get_logger(), "%s yaml:%s", PARAMETER_SERVER_FUNCTION, persistent_yaml_file_.c_str());
24+
25+
int storing_period = 0;
26+
// if automatically_declare_parameters_from_overrides is false, then the parameter_overrides will not be declared.
27+
@@ -190,7 +196,7 @@ ParameterServer::ParameterServer(
28+
29+
ParameterServer::~ParameterServer()
30+
{
31+
- RCLCPP_DEBUG(this->get_logger(), "%s", __PRETTY_FUNCTION__);
32+
+ RCLCPP_DEBUG(this->get_logger(), "%s", PARAMETER_SERVER_FUNCTION);
33+
this->remove_on_set_parameters_callback(callback_handler_.get());
34+
StoreYamlFile();
35+
}
36+
@@ -220,7 +226,7 @@ void ParameterServer::CheckYamlFile() {
37+
}
38+
39+
void ParameterServer::CheckYamlFile(const std::string& file) {
40+
- RCLCPP_DEBUG(this->get_logger(), "%s", __PRETTY_FUNCTION__);
41+
+ RCLCPP_DEBUG(this->get_logger(), "%s", PARAMETER_SERVER_FUNCTION);
42+
YAML::Node parameter_config = YAML::LoadFile(file);
43+
// check format "YAML must be dictionary type and level 1 can only have one key"
44+
if ((parameter_config.size() == 1 && parameter_config.Type() != YAML::NodeType::Map) ||
45+
@@ -268,7 +274,7 @@ void ParameterServer::CheckYamlFile(const std::string& file) {
46+
47+
void ParameterServer::LoadYamlFile()
48+
{
49+
- RCLCPP_DEBUG(this->get_logger(), "%s", __PRETTY_FUNCTION__);
50+
+ RCLCPP_DEBUG(this->get_logger(), "%s", PARAMETER_SERVER_FUNCTION);
51+
// check whether yaml file exist
52+
if (!boost::filesystem::exists(persistent_yaml_file_))
53+
{
54+
@@ -549,7 +555,7 @@ void ParameterServer::SaveNode(YAML::Emitter& out, YAML::Node node, const std::s
55+
56+
void ParameterServer::StoreYamlFile()
57+
{
58+
- RCLCPP_DEBUG(this->get_logger(), "%s", __PRETTY_FUNCTION__);
59+
+ RCLCPP_DEBUG(this->get_logger(), "%s", PARAMETER_SERVER_FUNCTION);
60+
61+
if (param_update_)
62+
{
63+
@@ -757,7 +763,7 @@ void ParameterServer::StoreYamlFile()
64+
65+
bool ParameterServer::CheckPersistentParam(const std::vector<rclcpp::Parameter> & parameters)
66+
{
67+
- RCLCPP_DEBUG(this->get_logger(), "%s", __PRETTY_FUNCTION__);
68+
+ RCLCPP_DEBUG(this->get_logger(), "%s", PARAMETER_SERVER_FUNCTION);
69+
bool flag = false;
70+
71+
for (auto& parameter : parameters) {

0 commit comments

Comments
 (0)