Uh oh!
There was an error while loading. Please reload this page.
Update qos profile -- take 2 - #25
Conversation
6a7ef48 to
8201da2Compareivanpauno
commented
Sep 8, 2020
Converting to draft until #30 is merged. |
8201da2 to
2648f10Compare* Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
2648f10 to
0a9fb5fCompare| default: | ||
| std::ostringstream oss{"unknown history policy value: ", std::ios_base::ate}; | ||
| oss << qos.history; | ||
| rcljava_throw_exception(env, "java/lang/IllegalStateException", oss.str()); |
There was a problem hiding this comment.
It looks like we're only outputting the invalid value for the history policy and not in cases of invalid values for other QoS settings. I would update this (or the other default cases) to be consistent.
There was a problem hiding this comment.
Yeah, this is a leftover. I used that while debugging.
Uh oh!
There was an error while loading. Please reload this page.
| * QoSProfile.sensorData(); // get predefined sensor data qos profile | ||
| */ | ||
| public class QoSProfile { | ||
| // TODO(ivanpauno): Update all qos policies in a way that the objects are created from RCL, |
There was a problem hiding this comment.
I think this is done in this PR, right?
There was a problem hiding this comment.
There were two TODOs:
- Avoiding to hard code the default profiles, that is being fixed here.
- Avoiding to hard code the policies enumeration numbers, that's not being fixed here.
This comment was referring to the second, if it's not clear I can try to rephrase it.
There was a problem hiding this comment.
Do you think it's worth doing the second point at all? I don't see an issue using separate enum values within rcljava, though I found a similar TODO in rclpy.
There was a problem hiding this comment.
Do you think it's worth doing the second point at all? I don't see an issue using separate enum values within rcljava, though I found a similar TODO in rclpy.
The issue is that you have to keep the numbers synced.
If the numbers get out of sync it might be a pretty hard bug to find, causing unexpected behavior to the user.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| QoSProfile qos = new QoSProfile(); | ||
| qos.nativeFromRCL(qos.nativeGetHandleFromName("default")); |
There was a problem hiding this comment.
Is it possible to make nativeFromRCL a static method? It might clean up the implementation a bit, but I'm not sure.
Then this can be rewritten as
returnnativeFromRCL(nativeGetHandleFromName("default"));Further, if there's no other intended use for nativeGetHandleFromName, we could just provide a single native method instead, e.g.
returnnativeFromRCL("default");There was a problem hiding this comment.
I'm using the nativeFromRCL that takes a handle in #26:
ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_graph_EndpointInfo.cpp
Lines 102 to 104 in 7bd6cc4
The difference is that in this way nativeFromRCL can be called in an already constructed QoS object.
Maybe that's not quite useful, but I originally thought that I was going to use that.
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> Co-authored-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
ivanpauno
commented
Sep 9, 2020
Going in, thanks for reviewing @jacobperron ! |
* Improve QoSProfile constructors * Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Improve QoSProfile constructors * Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Improve QoSProfile constructors * Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Improve QoSProfile constructors * Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Improve QoSProfile constructors * Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
* Improve QoSProfile constructors * Add documentation to QoSProfile class * Add fromRCL method to QoSProfile * Use fromRCL to create the built-in qos profiles. Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Follow up of #20.
Some of this changes are required by #26, some are unrelated improvements.