View my account

How to specify parameters using lauch file

Comments

5 comments

  • MartyX Grover

    Hi Makoto Terabayashi

    You cannot define an Advanced Mode parameter such as Second Peak Threshold (also known as Second Peak Delta) in a launch file directly.  You could though define it in a json camera configuration file and load the json at launch using the launch file or the roslaunch instruction.  An example of an instruction for this setting to place in the json file is:

    "param-secondpeakdelta": "325"

     


    If you are not familiar with json files, also called Visual Presets, you can read their official documentation page at the link below.

    https://dev.intelrealsense.com/docs/d400-series-visual-presets

     


    A json file can be loaded from the launch file by defining a path to the file with the json_file_path parameter.

    https://github.com/IntelRealSense/realsense-ros/blob/development/realsense2_camera/launch/rs_camera.launch#L5

    0
    Comment actions Permalink
  • Makoto Terabayashi

    Hello MartyG
    Thank you for your prompt reply.

    I was able to create and load a json file.
    However, the setting value cannot be changed by this procedure.
    Is there no choice but to recreate the json file to change the settings?

    thank you.

    0
    Comment actions Permalink
  • MartyX Grover

    Typically when setting different Advanced Mode values with a json after a json has already been loaded, you would have to stop the pipeline, load a different json file and then restart the pipeline to apply the change.

     

    I would speculate that instead of using a json file, you may be able to access Advanced Mode directly to make a change to the Second Peak Threshold during ROS runtime by launching a Python pyrealsense2 node script in ROS.  The link below suggests code for doing so.

    https://github.com/IntelRealSense/librealsense/issues/10224#issuecomment-1060412603

    0
    Comment actions Permalink
  • Makoto Terabayashi

    Hello Marty G
    Sorry for the late reply.

    I am considering how to reload the json file after changing it.

    Thanks to you, I was able to achieve my goal.

    1
    Comment actions Permalink
  • MartyX Grover

    That's great news that you were successful.  Thanks very much for the update!

    0
    Comment actions Permalink

Please sign in to leave a comment.