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 rosbag device loading by preventing set_option to HDR/Gain/Exposure #2409

Merged
merged 2 commits into from
Jul 17, 2022

Conversation

SamerKhshiboun
Copy link
Collaborator

Tracked by [LRS-445]

If rosbag file was loaded, a virtual device cannot set options of HDR/Exposure/Gain
Prevent that by asking if we are on a rosbag file

@@ -97,7 +97,8 @@ namespace realsense2_camera
BaseRealSenseNode(rclcpp::Node& node,
rs2::device dev,
std::shared_ptr<Parameters> parameters,
bool use_intra_process = false);
bool use_intra_process = false,
bool is_rosbag_file = false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are getting the rs2::device as well, try to drop the new parameter (all over the code) and use this API, see if it's possible:

if (dev.is<playback>())

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
It make sense and make the code easier.
I saw the PR you talked about, but still I wanted to do this without asking the primary node about rosbag_filename parameter value, since I don't thinks this is the best way to do this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, Lets also check if this API works too:

sensor.is<playback_sensor>()

If this works we can drop more changes.
Worth checking

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it's possible, I don't see playback_sensor in the API

@Nir-Az
Copy link
Collaborator

Nir-Az commented Jul 13, 2022

Have you seen this PR #2404 ?

@maloel maloel merged commit c1a5c45 into IntelRealSense:ros2-beta Jul 17, 2022
@SamerKhshiboun SamerKhshiboun deleted the fix_rosbag branch January 3, 2023 12:18
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.

3 participants