real-robot


Namereal-robot JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryReal Robot
upload_time2024-09-06 04:13:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2023 Kolin Guo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords robotics sensor visualization control
VCS
bugtrack_url
requirements None pyrealsense2
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # RealRobot
Real robot interface to connect with ManiSkill2

Runs camera capturing and visualization as separate processes to make it closer to using ROS

:exclamation: This repo is still under heavy development, so API might be changed without notice

## Installation

From PyPI
```bash
python3 -m pip install -U real-robot
```

If you need to install the optional `xarm` dependency, you must install from GitHub repo
```bash
python3 -m pip install -U real-robot[xarm]@git+https://github.com/KolinGuo/RealRobot.git
```

---

Calibrated camera poses are stored in [real_robot/assets/hec_camera_poses/](real_robot/assets/hec_camera_poses) and
loaded in [real_robot/sensors/camera.py](real_robot/sensors/camera.py).

## Helpful Tools

* Capture Color/Depth/IR images from RS camera, do
  ```bash
  python3 -m real_robot.tools.rs_capture
  ```
* Get detailed device information of connected RealSense device
  (*e.g.*, supported stream configs, sensor intrinsics, extrinsics between sensors), do
  ```bash
  python3 -m real_robot.tools.enumerate_rs_devices > info.log
  ```
* Convert recorded ROS bag file and save rgb & depth images into .npz, do
  ```bash
  python3 -m real_robot.tools.convert_rosbag_to_frames <bag_path>
  ```

## Notes

To fix an unindexed rosbag recorded from `RSDevice`, do
```bash
apt install -y python3-rosbag
rosbag reindex <bag_path>
```

## Known Issue
- [ ] When controlling xArm7 with `motion_mode="cartesian_online"` and `wait=True`,
  sometimes the robot will be stuck indefinitely in `wait_move()` due to `get_state()`
  returns wrong state (i.e., returns `state=1` thinking it's still in motion).
  Simple solution can be just to control briefly via UFACTORY Studio to get it unstuck.

## Changelog

<details>
<summary>0.1.0</summary>
<p>

### New features
* Added `SharedObject` to create/mount objects stored in `SharedMemory`
* Enabled `RSDevice` to run as a separate process (now `Camera` will create
  `RSDevice` as a separate process)
* Enabled `RSDevice` to record camera streams as a rosbag file
* Enabled `XArm7` to run as a separate process (for streaming robot states)
* Enabled `CV2Visualizer` and `O3DGUIVisualizer` to run as separate processes (for visualization)
* Added a default `FileHandler` to all Logger created through `real_robot.utils.logger.get_logger`
* Allow enabling selected camera streams from `RSDevice` and `sensors.camera.Camera`
* Added `sensors.simsense_depth.SimsenseDepth` class to generate depth image from stereo IR images

### API changes
* `real_robot.agents.xarm`
  * Change `XArm7` parameters for clarity (`safety_boundary` => `safety_boundary_mm`, `boundary_clip_eps` => `boundary_clip_mm`)
  * Add `get_gripper_position()` to get gripper opening width in mm or m
  * Add `gripper_speed` parameter to `set_action()` to control gripper speed
* `real_robot.utils.visualization.visualizer`
  * Rename `Visualizer` method `show_observation()` => `show_obs()`
* `real_robot.sensors.camera`
  * `CameraConfig` now accepts a `config` parameter
  * Rename `CameraConfig` parameter `parent_pose_fn` => `parent_pose_so_name`
* `real_robot.utils.realsense`
  * `RSDevice` now accepts `device_sn` instead of an `rs.device`
  * `RSDevice` now accepts `config` as parameter (`width`, `height`, `fps`) instead of `rs.config`

### Other changes
* Switch from `gym` to `gymnasium`
* Rename all `control_mode` by removing `pd_` prefix for clarity. No PD controller is used.
* `real_robot.agents.xarm`
  * `XArm7` will not clear *"Safety Boundary Limit"* error automatically in `set_action()`
  * For `motion_mode == "position"`, switch from using `set_tool_position()` to `set_position()`
  * Enable gripper and set to maximum speed in `reset()`
* Remove all Loggers created as global variables (they will be created
  at import, which might not be saved under `REAL_ROBOT_LOG_DIR`)
* Bugfix in xArm-Python-SDK: enable `wait=True` for modes other than position mode

</p>
</details>

<details>
<summary>0.0.2</summary>
<p>

* Added motion_mode to XArm7 agent
* Added several control_mode: `pd_ee_pos`, `pd_ee_pose_axangle`,
`pd_ee_delta_pose_axangle`, `pd_ee_pose_quat`, `pd_ee_delta_pose_quat`

</p>
</details>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "real-robot",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "robotics, sensor, visualization, control",
    "author": null,
    "author_email": "Kolin Guo <ruguo@ucsd.edu>",
    "download_url": "https://files.pythonhosted.org/packages/0b/a4/c4ae1d2c09f430a4ed94e2569a04defb2f65db52033810f10d07b0bbefde/real_robot-0.1.2.tar.gz",
    "platform": null,
    "description": "# RealRobot\nReal robot interface to connect with ManiSkill2\n\nRuns camera capturing and visualization as separate processes to make it closer to using ROS\n\n:exclamation: This repo is still under heavy development, so API might be changed without notice\n\n## Installation\n\nFrom PyPI\n```bash\npython3 -m pip install -U real-robot\n```\n\nIf you need to install the optional `xarm` dependency, you must install from GitHub repo\n```bash\npython3 -m pip install -U real-robot[xarm]@git+https://github.com/KolinGuo/RealRobot.git\n```\n\n---\n\nCalibrated camera poses are stored in [real_robot/assets/hec_camera_poses/](real_robot/assets/hec_camera_poses) and\nloaded in [real_robot/sensors/camera.py](real_robot/sensors/camera.py).\n\n## Helpful Tools\n\n* Capture Color/Depth/IR images from RS camera, do\n  ```bash\n  python3 -m real_robot.tools.rs_capture\n  ```\n* Get detailed device information of connected RealSense device\n  (*e.g.*, supported stream configs, sensor intrinsics, extrinsics between sensors), do\n  ```bash\n  python3 -m real_robot.tools.enumerate_rs_devices > info.log\n  ```\n* Convert recorded ROS bag file and save rgb & depth images into .npz, do\n  ```bash\n  python3 -m real_robot.tools.convert_rosbag_to_frames <bag_path>\n  ```\n\n## Notes\n\nTo fix an unindexed rosbag recorded from `RSDevice`, do\n```bash\napt install -y python3-rosbag\nrosbag reindex <bag_path>\n```\n\n## Known Issue\n- [ ] When controlling xArm7 with `motion_mode=\"cartesian_online\"` and `wait=True`,\n  sometimes the robot will be stuck indefinitely in `wait_move()` due to `get_state()`\n  returns wrong state (i.e., returns `state=1` thinking it's still in motion).\n  Simple solution can be just to control briefly via UFACTORY Studio to get it unstuck.\n\n## Changelog\n\n<details>\n<summary>0.1.0</summary>\n<p>\n\n### New features\n* Added `SharedObject` to create/mount objects stored in `SharedMemory`\n* Enabled `RSDevice` to run as a separate process (now `Camera` will create\n  `RSDevice` as a separate process)\n* Enabled `RSDevice` to record camera streams as a rosbag file\n* Enabled `XArm7` to run as a separate process (for streaming robot states)\n* Enabled `CV2Visualizer` and `O3DGUIVisualizer` to run as separate processes (for visualization)\n* Added a default `FileHandler` to all Logger created through `real_robot.utils.logger.get_logger`\n* Allow enabling selected camera streams from `RSDevice` and `sensors.camera.Camera`\n* Added `sensors.simsense_depth.SimsenseDepth` class to generate depth image from stereo IR images\n\n### API changes\n* `real_robot.agents.xarm`\n  * Change `XArm7` parameters for clarity (`safety_boundary` => `safety_boundary_mm`, `boundary_clip_eps` => `boundary_clip_mm`)\n  * Add `get_gripper_position()` to get gripper opening width in mm or m\n  * Add `gripper_speed` parameter to `set_action()` to control gripper speed\n* `real_robot.utils.visualization.visualizer`\n  * Rename `Visualizer` method `show_observation()` => `show_obs()`\n* `real_robot.sensors.camera`\n  * `CameraConfig` now accepts a `config` parameter\n  * Rename `CameraConfig` parameter `parent_pose_fn` => `parent_pose_so_name`\n* `real_robot.utils.realsense`\n  * `RSDevice` now accepts `device_sn` instead of an `rs.device`\n  * `RSDevice` now accepts `config` as parameter (`width`, `height`, `fps`) instead of `rs.config`\n\n### Other changes\n* Switch from `gym` to `gymnasium`\n* Rename all `control_mode` by removing `pd_` prefix for clarity. No PD controller is used.\n* `real_robot.agents.xarm`\n  * `XArm7` will not clear *\"Safety Boundary Limit\"* error automatically in `set_action()`\n  * For `motion_mode == \"position\"`, switch from using `set_tool_position()` to `set_position()`\n  * Enable gripper and set to maximum speed in `reset()`\n* Remove all Loggers created as global variables (they will be created\n  at import, which might not be saved under `REAL_ROBOT_LOG_DIR`)\n* Bugfix in xArm-Python-SDK: enable `wait=True` for modes other than position mode\n\n</p>\n</details>\n\n<details>\n<summary>0.0.2</summary>\n<p>\n\n* Added motion_mode to XArm7 agent\n* Added several control_mode: `pd_ee_pos`, `pd_ee_pose_axangle`,\n`pd_ee_delta_pose_axangle`, `pd_ee_pose_quat`, `pd_ee_delta_pose_quat`\n\n</p>\n</details>\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Kolin Guo  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Real Robot",
    "version": "0.1.2",
    "project_urls": {
        "Repository": "https://github.com/KolinGuo/RealRobot"
    },
    "split_keywords": [
        "robotics",
        " sensor",
        " visualization",
        " control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7f6de838478bb756fc17beb40de7b63263818557eca14731d4aaa4308bc904a0",
                "md5": "f143ee9fa851241028b62f59f07ec4c1",
                "sha256": "235b11d23babe1d09eb2cad2ca4655cf5ab3540b4eb12b578717f931c056ac69"
            },
            "downloads": -1,
            "filename": "real_robot-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f143ee9fa851241028b62f59f07ec4c1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19605336,
            "upload_time": "2024-09-06T04:13:43",
            "upload_time_iso_8601": "2024-09-06T04:13:43.679917Z",
            "url": "https://files.pythonhosted.org/packages/7f/6d/e838478bb756fc17beb40de7b63263818557eca14731d4aaa4308bc904a0/real_robot-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ba4c4ae1d2c09f430a4ed94e2569a04defb2f65db52033810f10d07b0bbefde",
                "md5": "e02142af936239c72be2b73a4d28e068",
                "sha256": "de2c75f4389b3e9fb4d1cc572175a03712bea3dc49cb7352fd428a51a7f83c93"
            },
            "downloads": -1,
            "filename": "real_robot-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e02142af936239c72be2b73a4d28e068",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 19582831,
            "upload_time": "2024-09-06T04:13:46",
            "upload_time_iso_8601": "2024-09-06T04:13:46.407159Z",
            "url": "https://files.pythonhosted.org/packages/0b/a4/c4ae1d2c09f430a4ed94e2569a04defb2f65db52033810f10d07b0bbefde/real_robot-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-06 04:13:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "KolinGuo",
    "github_project": "RealRobot",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": null,
            "specs": []
        },
        {
            "name": "pyrealsense2",
            "specs": [
                [
                    "==",
                    "2.54.2.5684"
                ]
            ]
        }
    ],
    "lcname": "real-robot"
}
        
Elapsed time: 0.79938s