Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This PR is targeting issue #4197. This PR is not a merge candidate - I'm trying to get feedback about direction only.
I've implement the functionality that allows me to emulate a D435i device on a
rs2.context
object. I can create a pipeline object and pass in a configuration that targets the emulated device by serial number. I can subsequently interrogate for camera_info, options, and grab frames. All of these settings are configured through the API. Here is an example python session where I create a trivial emulated device.Keep in mind, that my goal here was to get something functional - not to have the end all, be all, perfect solution and API. I've also not added unit tests yet because I want to make sure that the direction I'm heading is reasonable before investing time and energy into that.
I've primarily attempted to add this functionality by adding to the API only - not modifying it. There are very clearly ways that we could make the API for the software device more concise if we changed the signature of certain methods. For example,
rs2_software_sensor_add_writable_option
andrs2_software_sensor_add_read_only_option
are redundantly and could probably be combined into a single method with areadonly
argument. Are you accepting of this kind of consolidation of the software device API or would you prefer to have maximum backward compatibility?The current implementation adds a new
emulated
device backend because I didn't want to break functionality related to theplayback
devices. I would appreciate any feedback on this approach and how it integrates with the rest of the project. Specifically, in thecontext
object I have added a vector of emulated devices, and this has caused thecontext::create_devices
andcontext::on_device_change
method signatures to expand and become rather ugly. I could integrate this into theplatform::backend_device_group
object but I wasn't sure because theplayback
devices are stored separately from this group object. Thoughts?I did not see any unit tests for the python wrapper. Do you have a preferred platform for python unit tests if I were to try and add some ?