Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct cyber parameter BUILD and enable its test #15028

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YuqiHuai
Copy link
Contributor

@YuqiHuai YuqiHuai commented Jul 4, 2023

Fixes #15023


When running the provided example bazel run cyber/python/cyber_py3/examples:parameter
Buggy output:

clt param lst len is  1
b'{name: "global_parameter_service/list_parameters", type: "global_parameter_service/list_parameters", value: 888.880000}'

srv param lst len is  1
b'{name: "global_parameter_service/list_parameters", type: "global_parameter_service/list_parameters", value: 888.880000}'

Correct output:

clt param lst len is  3
b'{name: "author_score", type: "DOUBLE", value: 888.880000}'
b'{name: "author_name", type: "STRING", value: "WanderingEarth"}'
b'{name: "author_age", type: "INT", value: 5000}'

srv param lst len is  3
b'{name: "author_score", type: "DOUBLE", value: 888.880000}'
b'{name: "author_name", type: "STRING", value: "WanderingEarth"}'
b'{name: "author_age", type: "INT", value: 5000}'

We can also re-enable the test named "parameter_test" under cyber/python/cyber_py3/test as this test now passes with the fix.

$ bazel test cyber/python/cyber_py3/test:parameter_test
//cyber/python/cyber_py3/test:parameter_test                             PASSED in 1.3s

When running the example in the issue report
Buggy output:

E0704 01:18:28.815487 143263 py_parameter.cc:516] [cyber_py]pyparam_srv get_parameter is false!
E0704 01:18:28.815500 143263 py_parameter.cc:516] [cyber_py]pyparam_srv get_parameter is false!
E0704 01:18:28.815505 143263 py_parameter.cc:516] [cyber_py]pyparam_srv get_parameter is false!
E0704 01:18:28.815510 143263 parameter.h:326] [cyber_py]The type of parameter "" is , not STRING
car_type : b''
E0704 01:18:28.815526 143263 parameter.h:314] [cyber_py]The type of parameter "" is , not DOUBLE
height : 0.0
E0704 01:18:28.815537 143263 parameter.h:303] [cyber_py]The type of parameter "" is , not INT
lasers : 0
name : b'STRING'
typename : b'STRING'
debug_String : b'{name: "STRING", type: "STRING", value: "apollo"}'
------------------------------------------------------------
name : b'INT'
typename : b'INT'
debug_String : b'{name: "INT", type: "INT", value: 4}'
------------------------------------------------------------
name : b'DOUBLE'
typename : b'DOUBLE'
debug_String : b'{name: "DOUBLE", type: "DOUBLE", value: 1.890000}'
------------------------------------------------------------
E0704 01:18:28.815587 143263 py_parameter.cc:516] [cyber_py]pyparam_srv get_parameter is false!
E0704 01:18:28.815591 143263 parameter.h:303] [cyber_py]The type of parameter "" is , not INT
after change, lasers : 0

Correct output:

car_type : b'apollo'
height : 1.89
lasers : 4
name : b'lasers'
typename : b'INT'
debug_String : b'{name: "lasers", type: "INT", value: 4}'
------------------------------------------------------------
name : b'car_type'
typename : b'STRING'
debug_String : b'{name: "car_type", type: "STRING", value: "apollo"}'
------------------------------------------------------------
name : b'height'
typename : b'DOUBLE'
debug_String : b'{name: "height", type: "DOUBLE", value: 1.890000}'
------------------------------------------------------------
after change, lasers : 10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cyber中参数服务通讯中,python端有BUG
1 participant