ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

issue in dynamic reconfig client

asked 2021-10-19 06:11:50 -0500

dinesh gravatar image

updated 2021-10-19 22:52:01 -0500

When i set the dynamic reconfig value from c++ client. i'm getting this error:

[ERROR] [1634641746.152133244]: SectorFilterConfig::__fromMessage__ called with an unexpected parameter.
[ERROR] [1634641746.152156567]: Booleans:
[ERROR] [1634641746.152166463]: Integers:
[ERROR] [1634641746.152192406]: Doubles:
[ERROR] [1634641746.152220314]:   /laser_filter/scan_filter/range_max
[ERROR] [1634641746.152243397]: Strings:

Here is the code:

    dynamic_reconfigure::ReconfigureRequest srv_req;
    dynamic_reconfigure::ReconfigureResponse srv_resp;

    dynamic_reconfigure::Config conf;

    dynamic_reconfigure::StrParameter angle_segments;
    angle_segments.name = "/laser_filter/scan_filter/angle_segments";
    angle_segments.value = "0,0";
    conf.strs.push_back(angle_segments);

    srv_req.config = conf;

    ros::service::call("/laser_filter/scan_filter/set_parameters", srv_req, srv_resp);

cfg file of the dynamic parameters:

from dynamic_reconfigure.parameter_generator_catkin import *

PACKAGE = "laser_filters"

gen = ParameterGenerator()

gen.add("angle_segments", str_t, 0, "List of angular segments (radians)", "1,2,3,4")
gen.add("range_min", double_t, 0,
        "Min radius of the circle sector (meter)", 0.0, 0.0, 100000.0)
gen.add("range_max", double_t, 0,
        "Max radius of the circle sector (meter)", 100000.0, 0.0, 100000.0)

gen.add("clear_inside", bool_t, 0, "True to clear inside of the circle sector, False to clear outside. Default: true", True)
gen.add("invert", bool_t, 0, "A Boolean to invert the filter", False)

exit(gen.generate(PACKAGE, "laser_filters", "SectorFilter"))
edit retag flag offensive close merge delete

Comments

Quick comment: locale? The comma (,) is only used in parts of the world in floating point number notation. In others it's the dot (.).

gvdhoorn gravatar image gvdhoorn  ( 2021-10-19 06:45:21 -0500 )edit

I didn't understand it properly. when i replace comma with dot inside string still the same error is comming. I've updated question with .cfg of the parameters.

dinesh gravatar image dinesh  ( 2021-10-19 22:51:33 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-20 01:15:39 -0500

gvdhoorn gravatar image

The name (angle_segments) combined with the , caused me to assume it was a double. It's in fact a string.

So it's likely a comma-separated list, which you have. That should be ok.

angle_segments.name should probably not include the fully qualified name, but just the name of the parameter. So angle_segments should be sufficient.

edit flag offensive delete link more

Comments

Omg, thats all? It solved the issue i was facing. Thanks. Issue was this small but i stuck on it for like 2 days. By the way isn't their method to use list instead of string in dynamic reconfigure?

dinesh gravatar image dinesh  ( 2021-10-20 01:49:43 -0500 )edit

That sounds like another question, which you should post as a new one.

gvdhoorn gravatar image gvdhoorn  ( 2021-10-20 02:53:49 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2021-10-19 06:11:50 -0500

Seen: 149 times

Last updated: Oct 19 '21