Comments (14)
UPDATE: Shaving even more performance out of the benchmark.
Version 0.8 (master): 560 ms
Version 1.0 beta (dev): 220 ms
from ros_type_introspection.
I dropped some comments on commits here (should see with little message box) https://github.com/facontidavide/ros_type_introspection/commits/dev
from ros_type_introspection.
fyi, in dev, tests fail
from ros_type_introspection.
these methods should probably be const methods as in void method()
=> void method() const
since they do not/should not mutate object state
ros_type_introspection/include/ros_type_introspection/ros_introspection.hpp
Lines 132 to 135 in 418cc40
ros_type_introspection/include/ros_type_introspection/ros_introspection.hpp
Lines 175 to 177 in 418cc40
this can be made const
ros_type_introspection/include/ros_type_introspection/ros_introspection.hpp
Lines 157 to 159 in 418cc40
if
is changed from
operator[]
which will do an insertion (unwanted probably) with .at()
from ros_type_introspection.
helper_funtions.hpp
=> helper_functions.hpp
from ros_type_introspection.
thank you for the valuable remarks, I completely missed the typos and the const.
Test is not failing on my most up to date version. If it still fails on your PC, send me the error message.
from ros_type_introspection.
ran tests on commit c77c728
[==========] Running 16 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 5 tests from RosType
[ RUN ] RosType.builtin_int32
[ OK ] RosType.builtin_int32 (0 ms)
[ RUN ] RosType.builtin_string
[ OK ] RosType.builtin_string (0 ms)
[ RUN ] RosType.builtin_fixedlen_array
/data2/ws_gcc/ws_ros_lunar/src/ros_type_introspection/src/tests/parser_test.cpp:51: Failure
Expected: f.arraySize()
Which is: 0
To be equal to: 32
[ FAILED ] RosType.builtin_fixedlen_array (0 ms)
[ RUN ] RosType.builtin_dynamic_array
[ OK ] RosType.builtin_dynamic_array (0 ms)
[ RUN ] RosType.no_builtin_array
[ OK ] RosType.no_builtin_array (0 ms)
[----------] 5 tests from RosType (1 ms total)
[----------] 4 tests from ROSMessageFields
[ RUN ] ROSMessageFields.ParseComments
[ OK ] ROSMessageFields.ParseComments (0 ms)
[ RUN ] ROSMessageFields.constant_uint8
[ OK ] ROSMessageFields.constant_uint8 (0 ms)
[ RUN ] ROSMessageFields.ConstantNavstatus
[ OK ] ROSMessageFields.ConstantNavstatus (1 ms)
[ RUN ] ROSMessageFields.ConstantComments
[ OK ] ROSMessageFields.ConstantComments (1 ms)
[----------] 4 tests from ROSMessageFields (2 ms total)
[----------] 2 tests from BuildROSTypeMapFromDefinition
[ RUN ] BuildROSTypeMapFromDefinition.IMUparsing
/data2/ws_gcc/ws_ros_lunar/src/ros_type_introspection/src/tests/parser_test.cpp:255: Failure
Expected: msg->field(2).arraySize()
Which is: 5
To be equal to: 9
/data2/ws_gcc/ws_ros_lunar/src/ros_type_introspection/src/tests/parser_test.cpp:262: Failure
Expected: msg->field(4).arraySize()
Which is: 5
To be equal to: 9
/data2/ws_gcc/ws_ros_lunar/src/ros_type_introspection/src/tests/parser_test.cpp:269: Failure
Expected: msg->field(6).arraySize()
Which is: 0
To be equal to: 9
[ FAILED ] BuildROSTypeMapFromDefinition.IMUparsing (3 ms)
[ RUN ] BuildROSTypeMapFromDefinition.Int16MultiArrayParsing
[ OK ] BuildROSTypeMapFromDefinition.Int16MultiArrayParsing (1 ms)
[----------] 2 tests from BuildROSTypeMapFromDefinition (4 ms total)
[----------] 4 tests from Deserialize
[ RUN ] Deserialize.JointState
[ OK ] Deserialize.JointState (2 ms)
[ RUN ] Deserialize.NavSatStatus
[ OK ] Deserialize.NavSatStatus (1 ms)
[ RUN ] Deserialize.DeserializeIMU
unknown file: Failure
C++ exception with description "buildRosFlatType: There was an error parsing the buffer" thrown in the test body.
[ FAILED ] Deserialize.DeserializeIMU (2 ms)
[ RUN ] Deserialize.Int16MultiArrayDeserialize
[ OK ] Deserialize.Int16MultiArrayDeserialize (1 ms)
[----------] 4 tests from Deserialize (6 ms total)
[----------] 1 test from Renamer2
[ RUN ] Renamer2.DeserializeJointStateAndRename
[ OK ] Renamer2.DeserializeJointStateAndRename (2 ms)
[----------] 1 test from Renamer2 (2 ms total)
[----------] Global test environment tear-down
[==========] 16 tests from 5 test cases ran. (15 ms total)
[ PASSED ] 13 tests.
[ FAILED ] 3 tests, listed below:
[ FAILED ] RosType.builtin_fixedlen_array
[ FAILED ] BuildROSTypeMapFromDefinition.IMUparsing
[ FAILED ] Deserialize.DeserializeIMU
3 FAILED TESTS
from ros_type_introspection.
I do not have this problem. Which compiler are you using?
Which Boost version?
from ros_type_introspection.
I'm using ros lunar. Compiler gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
from ros_type_introspection.
:( I will try to install a version of lunar and see why this is happening. It is super weird.
Could it be a problem with atoi? Can you debug it on your computer and check the value of these lines for the failing tests?
std::string size(what[3].first, what[3].second);
_array_size = size.empty() ? -1 : atoi(size.c_str());
from ros_type_introspection.
okay, I found that problem. assigning to type
after the match will corrupt the results.
doing
std::string type_tmp = type;
if (regex_search(type_tmp, what, array_regex))
works fine
from ros_type_introspection.
Awesome! Just pushed the fix
from ros_type_introspection.
I am about to close this and merge dev into master (and release it on ROS Indigo, Kinetic and Lunar).
The refactoring is not 3X faster than the original code and looking at the results of Callgrind I can not see any low hanging fruit for further optimization.
from ros_type_introspection.
pushed
from ros_type_introspection.
Related Issues (20)
- ROSTypeFlat::tree shall be moved to BuildROSTypeMapFromDefinition
- Deserialize Object with BuitInTypes without recursion
- Move to abseil HOT 11
- Update Wiki HOT 5
- Lookup ROS msg definitions HOT 20
- Serialize a message? HOT 9
- Does not build with the latest abseil-cpp from https://github.com/Eurecat/abseil-cpp HOT 2
- Partially deserialize the message? HOT 3
- Building a tree with values from FlatMessage HOT 4
- [SUGGESTION] Parser::applyVisitorToBuffer to support early termination HOT 3
- Problems with some message types HOT 4
- How can/why is ShapeShifter::instantiate const? HOT 7
- Parser::applyVisitorToBuffer() method is slow for sensor_msgs/Image HOT 5
- gcc 7.4.0 gives [-Wmaybe-uninitialized] on code using variant.hpp's convert function HOT 1
- Filter out variables
- Bridging generic subscribers and publishers
- -Wsign-compare warnings triggered by abseil removal
- Noetic release?
- File to message in c++ HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ros_type_introspection.