Comments (14)
I will discuss your issue with my Intel RealSense colleagues. Thanks very much for your patience.
from librealsense.
Hi @oscarthorn If one of the existing Visual Presets (jsons) provided by the RealSense SDK is close to your custom json then you could try applying that preset instead of loading your custom json as a string by using the C++ code at the link below.
Here is a list of the parameter names of the presets so that you can amend the code in the above link to use the appropriate preset.
RS2_RS400_VISUAL_PRESET_CUSTOM
RS2_RS400_VISUAL_PRESET_DEFAULT
RS2_RS400_VISUAL_PRESET_HAND
RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY
RS2_RS400_VISUAL_PRESET_HIGH_DENSITY
RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY
RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN
RS2_RS400_VISUAL_PRESET_COUNT
from librealsense.
Hi @MartyG-RealSense, no none of the presets are suitable
from librealsense.
In addition to the C++ json cases that you linked to at the beginning, there is also another example of using dev.asrs400::advanced_mode(); at #3277 (comment)
A less efficient alternative to json may be to investigate whether the settings that you are using in the json can be applied with C++ script code instead.
If your preference is to use the custom json file then you could investigate whether using threads and putting the record function on a separate thread from the json loading code might make a difference. There is a C++ threads example at #6865 though I would personally recommend against using threading unless there is no other option as it makes programs more complex.
from librealsense.
The problem is not with the json loading the problem is that dev.as<rs400::advanced_mode>();
returns a nullptr. Could you clarify if #3277 is relevant to that?
I have no problem setting them manually, are the settings available without accessing advanced mode with dev.as<rs400::advanced_mode>();
?
There is no recording function to put on a separate thread, please clarify if there is something I could change. This problem occurs regardless of if dev.as<rs400::advanced_mode>();
is called before or after pipe.start().
from librealsense.
It would depend on which settings you want to change. If they are Advanced Mode settings then there is little available documentation for controlling those options, unfortunately. If it is non-Advanced Mode options such as exposure then it is straightforward to change those with C++ code.
There is not enough information available about this particular nullptr issue (using json + record in the same script) for me to offer advice about the relevancy of #3277 unfortunately. I do apologize.
#3802 is a C++ discussion about implementing threading for recording a bag with cfg.enable_record_to_file()
from librealsense.
Is there a way to get a hold of the developer team for librealsense to get the bug resolved? So far I have traced it to the serializable_device constructor setting the device to null.
from librealsense.
My findings so far
dev.as<rs400::advanced_mode>();
calls as()
in rs_device.hpp which tries to construct the correct type advanced_mode
. The advanced_mode
constructor calls the serializable_device
constructor which in turn sets _dev
(the member variable that holds the actual rs2_device struct) to nullptr since rs2_is_device_extendable_to(_dev.get(), RS2_EXTENSION_SERIALIZABLE, &e)
returns 0.
I will try to determine why that is, my assumption is that there is some interface/inheritance missing somewhere which causes the VALIDATE_INTERFACE_NO_THROW,
macro to fail but it would be good to get input from someone involved in this code.
from librealsense.
Okey, so the main issue seems to be that in VALIDATE_INTERFACE_NO_THROW_ADV
the statement ext->extend_to(TypeToExtension<T>::value, (void**)&p)
evaluates to false since extend_to
in record_device
does not implement RS2_EXTENSION_SERIALIZABLE
as an extension it can extend to. Not sure if this is an oversight or on purpose.
from librealsense.
Just adding the serializable extension and making it extend to advanced seems to resolve the issue. Though I'm not sure if this is a valid solution. I tried extending it to serializable but that interface does not have create_snapshot which is expected by write_device_extension_changes
. So I would love clarification from a developer if this is a valid solution that you can implement (or I can open a PR).
case RS2_EXTENSION_SERIALIZABLE:
case RS2_EXTENSION_ADVANCED_MODE : return extend_to_aux<RS2_EXTENSION_ADVANCED_MODE >(m_device, ext);
from librealsense.
Don't have time to investigate that also but dev.first<rs2::color_sensor>().as<rs2::roi_sensor>()
also seems to return nullptr if you have enabled recording.
Used to set region of interest for exposure with .set_region_of_interest(roi);
from librealsense.
Hi @oscarthorn My colleagues were able to replicate the issue and created an internal Intel report so that it can be investigated as a possible bug. They also said that you are more than welcome to submit a PR.
I have added an Enhancement label to this case to signify that it should be kept open.
from librealsense.
Hi @MartyG-RealSense Thanks, sounds good!
For now I found a workaround after realizing that realsense-viewer does not seem to have the same problem. After looking at the code the it seems to use the recorder
class directly and not setting the record setting on the pipeline. Just instantiating with recorder = std::make_shared<recorder>(path, dev);
seems to do the trick without polluting the device interface. You can then use the usual functions and if you want to stop recording you can just run recorder.reset();
and the restart again (possibly to a different file) with recorder.reset(new rs2::recorder(path, dev));
Perhaps this method of recording could be added to the examples or documentation?
Thanks for the help!
from librealsense.
You are very welcome. Thanks so much for sharing the details of your workaround!
from librealsense.
Related Issues (20)
- Launching multiple L515 cameras at once take time to start the camera HOT 37
- Segment tree (foreground) from background with RGB and **complicated** depth data HOT 5
- how to enable firmware logs through c++? HOT 4
- RealSense Can't list camera, D435 for windows 11 HOT 13
- can't open camera HOT 2
- Windows connects to D435i over ethernet HOT 7
- How to generate a solid (not just a surface) after 3D scanning and reconstruction with realsense D405 camera? HOT 2
- Flickering Issue on realsense d450 HOT 6
- How to read through a bag file ONCE HOT 2
- Jfrog repo is not available HOT 9
- IMU - roll can fluctuate between 10 degree difference. Is that normal? HOT 5
- Distorsion Correction HOT 3
- Failed to resolve the request HOT 4
- try to install pyrealsense at raspian HOT 6
- Depth Quality Tool for Intel RealSense Cameras Execution error HOT 16
- D435i + problem with topic imu (orientation) + urdf HOT 6
- D455 - Stopped Working HOT 2
- Orin nano failed to read USB config descriptor HOT 10
- Realsense-viewer crashes while opening on MacOS sonoma HOT 3
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 librealsense.