{"id":21274033,"url":"https://github.com/flexrobotics/roboflex_realsense","last_synced_at":"2026-02-13T04:47:52.639Z","repository":{"id":201797045,"uuid":"707418168","full_name":"flexrobotics/roboflex_realsense","owner":"flexrobotics","description":"Roboflex support for broadcasting rgb and depth messages from the realsense camera.","archived":false,"fork":false,"pushed_at":"2025-10-20T02:37:24.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-06T09:59:22.960Z","etag":null,"topics":["realsense2","roboflex"],"latest_commit_sha":null,"homepage":"https://github.com/flexrobotics/roboflex_realsense","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flexrobotics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-19T21:22:34.000Z","updated_at":"2025-10-20T02:37:27.000Z","dependencies_parsed_at":"2025-07-11T06:34:06.772Z","dependency_job_id":"7f35acfa-5113-42d8-bfea-167b7744b2e1","html_url":"https://github.com/flexrobotics/roboflex_realsense","commit_stats":null,"previous_names":["flexrobotics/roboflex_realsense"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flexrobotics/roboflex_realsense","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_realsense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_realsense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_realsense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_realsense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flexrobotics","download_url":"https://codeload.github.com/flexrobotics/roboflex_realsense/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flexrobotics%2Froboflex_realsense/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29396843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T04:26:15.637Z","status":"ssl_error","status_checked_at":"2026-02-13T04:16:29.732Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["realsense2","roboflex"],"created_at":"2024-11-21T09:18:40.829Z","updated_at":"2026-02-13T04:47:52.625Z","avatar_url":"https://github.com/flexrobotics.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# roboflex.realsense\n\nSupport for the Realsense D435 camera. We really just wrap the sdk and encode data into messages. It might work with other D4** cameras - YMMV.\n\n## System Dependencies\n\nSort of: none. We use cmake to build. If find_package(realsense2) fails (meaning cmake can't find some system-installed version of realsense2), we fetch and build it. \n\n## Install\n\n    pip install roboflex.realsense\n\n## Import\n\n    import roboflex.realsense as rr\n\n## Nodes\n\nThere is only one: **RealsenseSensor**\n\nYou can use a class method to discover the serial numbers of all the cameras currently connected to your computer:\n\n    rr.RealsenseSensor.get_connected_device_serial_numbers()\n\nThere are two ways to instantiate realsense sensors:\n\n1. Via the constructor - you must know the serial number. See below for documentation of the Config type.\n\n        sensor = rr.RealsenseSensor(\n            serial_number: str,\n            config: rr.Config,\n            name: str = \"RealsenseSensor\",\n        )\n\n2. Via a class method - if you have a single realsense attached,\nthis is the easiest way - you don't even have to know the serial number.\n\n        sensor = rr.RealsenseSensor.get_one_sensor(\n            config: rr.Config,\n            name: str = \"RealsenseSensor\",\n        )\n\nUse it like so:\n\n    # must be started!\n    sensor.start()\n\n    # You can get the serial number:\n    sensor.serial_number -\u003e str\n\n    # You can get the configuration back:\n    sensor.config -\u003e rr.Config\n\n    # You can get the two camera-k matrices:\n    sensor.depth_camera_k -\u003e np.array\n    sensor.color_camera_k -\u003e np.array\n\n    # You can get various device values:\n    sensor.width_pixels_color -\u003e int\n    sensor.height_pixels_color -\u003e int\n    sensor.width_pixels_depth -\u003e int\n    sensor.height_pixels_depth -\u003e int\n    sensor.fps_color -\u003e int\n    sensor.fps_depth -\u003e int\n\n    # You can manually trigger a message event:\n    # (for the most part you won't need this - only\n    # if you have special need to control the message\n    # production), and don't want to use \"start\".\n    sensor.produce()\n\n    # You can turn the IR laser off and on\n    sensor.set_laser_on_off(False)\n    sensor.set_laser_on_off(True)\n\n\n## Messages\n\nRealsenseSensor produces a single message type: **RealsenseFrameset**.\n\n    from roboflex.realsense import RealsenseFrameset\n\nAPI:\n\n    # the timestamp just before reading from device\n    message.t0 -\u003e Float\n\n    # the timestamp just after reading from device\n    message.t1 -\u003e Float\n\n    # numpy array of shape=(height, width, 3), dtype=uint8\n    message.rgb -\u003e np.ndarray\n\n    # numpy array of shape=(height, width), dtype=uint16\n    message.depth -\u003e np.ndarray\n\n    # numpy array of shape=(height, width), dtype=uint8\n    message.ir1 -\u003e np.ndarray\n\n    # numpy array of shape=(height, width), dtype=uint8\n    message.ir2 -\u003e np.ndarray\n\n    # which camera (if any) the frame is aligned to\n    message.aligned_to -\u003e rr.CameraType\n\n    # the serial number of the camera that produced this frameset\n    message.serial_number -\u003e str\n\n    # the color camera k of the camera that produced this frameset\n    message.camera_k_rgb -\u003e numpy array of (3, 3)\n\n    # the depth camera k of the camera that produced this frameset\n    message.camera_k_depth -\u003e numpy array of (3, 3)\n\n    # the ir1 camera k of the camera that produced this frameset\n    message.camera_k_ir1 -\u003e numpy array of (3, 3)\n\n    # the ir2 camera k of the camera that produced this frameset\n    message.camera_k_ir2 -\u003e numpy array of (3, 3)\n\n    # the index, from the device, of this frameset\n    message.frame_number -\u003e int\n\n    # the timestamp, from the device, of this frameset, in epoch seconds\n    message.timestamp -\u003e float\n\nDYNOFLEX:\n\n    d = DynoFlex.from_msg(message)\n\n    # the timestamp just before reading from device\n    d[\"t0\"] -\u003e Double\n\n    # the timestamp just after reading from device\n    d[\"t1\"] -\u003e Double\n\n    # numpy array of shape=(height, width, 3), dtype=uint8\n    d[\"rgb\"] -\u003e np.ndarray\n\n    # numpy array of shape=(height, width), dtype=uint16\n    d[\"depth\"] -\u003e np.ndarray\n\n    # numpy array of shape=(height, width), dtype=uint8\n    d[\"ir1\"] -\u003e np.ndarray\n\n    # numpy array of shape=(height, width), dtype=uint8\n    d[\"ir2\"] -\u003e np.ndarray\n\n    # which camera (if any) the frame is aligned to\n    d[\"aligned_to\"] -\u003e rr.CameraType\n\n    # the serial number of the camera that produced this frameset\n    d[\"serial_number\"] -\u003e str\n\n    # the color camera k of the camera that produced this frameset\n    d[\"camera_k_rgb\"] -\u003e numpy array of (3, 3)\n\n    # the depth camera k of the camera that produced this frameset\n    d[\"camera_k_depth\"] -\u003e numpy array of (3, 3)\n\n    # the camera k of the infrared camera 1 that produced this frameset\n    d[\"camera_k_ir1\"] -\u003e numpy array of (3, 3)\n\n    # the camera k of the infrared camera 2 that produced this frameset\n    d[\"camera_k_ir2\"] -\u003e numpy array of (3, 3)\n\n    # the index, from the device, of this frameset\n    d[\"n\"] -\u003e int\n\n    # the timestamp, from the device, of this frameset, in epoch seconds\n    d[\"t\"] -\u003e float\n\n## Other\n\nSome types used for configuration\n\nSome enums:\n\n    CameraType:\n        RGB,\n        DEPTH,\n        IR1,    # raw infrared camera1\n        IR2     # raw infrared camera2\n    \n    # You can OR these together like so:\n\n    my_cameras = camera_type_or([CameraType.RGB, CameraType.DEPTH, etc])\n\n    # You can test for camera types:\n\n    has_rgb = camera_type_contains(my_camera_type, CameraType.RGB)\n\n    CameraAlignment:\n        NONE,\n        RGB,\n        DEPTH\n\n    D400VisualPreset:\n        CUSTOM,\n        DEFAULT,\n        HAND,\n        HIGH_ACCURACY,\n        HIGH_DENSITY,\n        MEDIUM_DENSITY\n\nTemporalFilterParameters:\n\n    f = rr.TemporalFilterParameters(\n        alpha: float = 0.4,\n        delta: float = 20.0,\n        persistance_control: int = 7,\n    )\n\n    f.alpha -\u003e float\n    f.delta -\u003e float\n    f.persistance_control -\u003e int\n\nConfig:\n\n    # all paramters are optional - defaults shown below\n    c = rr.Config(\n        camera_type: rr.CameraType = CameraType.RGB | CameraType.DEPTH,\n        align_to: rr.CameraAlignment = rr.CameraAlignment.NONE,\n        prioritize_ae: Bool = False,\n        rgb_settings: Dict[str, int] = {\n            \"fps\": 0,\n            \"width\": 0,\n            \"height\": 0,\n        },\n        depth_settings: Dict[str, int] = {\n            \"fps\": 0,\n            \"width\": 0,\n            \"height\": 0,\n        },\n        depth_visual_preset: rr.D400VisualPreset = rr.D400VisualPreset.DEFAULT,\n        temporal_filter_parameters: rr.TemporalFilterParameters = None,\n        hole_filling_mode: Optional[int] = None,\n        decimation_filter: Optional[int] = None,\n    )\n\n    # which actual cameras are in use - this a bitmask, OR-ed together\n    c.camera_type -\u003e rr.CameraType\n\n    # which camera the frames will be aligned to (if any)\n    c.align_to -\u003e rr.CameraAligment\n\n    # When `true`, allows fps to drop in order to better expose\n    # frames, such as in dimly lit environments\n    c.prioritize_ae -\u003e Bool\n\n    # fps, height, and width of the color camera\n    c.rgb_settings -\u003e Dict[str, int]\n\n    # fps, height, and width of the depth camera\n    c.depth_settings -\u003e Dict[str, int]\n\n    # the depth camera visual preset\n    c.depth_visual_preset -\u003e rr.D400VisualPreset\n\n    # the temporal filter, if any - can be None\n    c.temporal_filter_parameters -\u003e rr.TemporalFilterParameters\n\n    # the 'hole filling mode', if any - can be None\n    # 0: fill_from_left\n    # 1: farthest_from_around\n    # 2: nearest_from_around\n    c.hole_filling_mode -\u003e int\n\n    # NOTE!\n    The realsense camera supports many more settings, such as laser power, etc. If there's something you want supported that's not\n    here, just let me know.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexrobotics%2Froboflex_realsense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflexrobotics%2Froboflex_realsense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflexrobotics%2Froboflex_realsense/lists"}