From 4a271c9aaff48bbec27e4129348a2093e4b59965 Mon Sep 17 00:00:00 2001 From: Lucas Walter Date: Sun, 10 Nov 2019 14:57:15 -0800 Subject: [PATCH] More detailed error message --- templates/ConfigType.h.template | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/ConfigType.h.template b/templates/ConfigType.h.template index 801a47b4..d10c0993 100644 --- a/templates/ConfigType.h.template +++ b/templates/ConfigType.h.template @@ -246,9 +246,11 @@ ${doline} ${linenum} "${filename}" } } - if (count != dynamic_reconfigure::ConfigTools::size(msg)) + const int msg_count = dynamic_reconfigure::ConfigTools::size(msg); + if (count != msg_count) { - ROS_ERROR("${configname}Config::__fromMessage__ called with an unexpected parameter."); + ROS_ERROR("${configname}Config::__fromMessage__ called with an unexpected number of" + " parameters: %d instead of %d.", msg_count, count); ROS_ERROR("Booleans:"); for (unsigned int i = 0; i < msg.bools.size(); i++) ROS_ERROR(" %s", msg.bools[i].name.c_str());