Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
_target_: robots.airbots.airbot_mmk.airbot_com_mmk2_bson.AIRBOTMMK2

ip: "192.168.11.200"

default_action: null

# The order is important
components: ["left_arm", "left_arm_eef", "right_arm", "right_arm_eef", "head", "spine", "base"]

# USB cameras (only color image types)
cameras:
head_camera:
image_types: ["color"]
camera_type: "USB"
video_device: "/dev/video0"
image_width: "640"
image_height: "480"
# left_camera:
# image_types: ["color"]
# camera_type: "USB"
# video_device: "/dev/video2"
# image_width: "640"
# image_height: "480"
# right_camera:
# image_types: ["color"]
# camera_type: "USB"
# video_device: "/dev/video4"
# image_width: "640"
# image_height: "480"

# # RealSense
# cameras:
# head_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
# left_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
# right_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
_target_: robots.airbots.airbot_mmk.airbot_com_mmk2_bson.AIRBOTMMK2

ip: "localhost"

# NOTE: If you want to change the order of each part, be careful to change the order of each observation and action in the data conversion script simultaneously
# components: ["left_arm", "left_arm_eef"]
components: ["left_arm", "left_arm_eef", "right_arm", "right_arm_eef", "base"]

# USB cameras (only color image types)
cameras:
head_camera:
image_types: ["color"]
camera_type: "USB"
video_device: "/dev/video0"
image_width: "640"
image_height: "480"
# left_camera:
# image_types: ["color"]
# camera_type: "USB"
# video_device: "/dev/video2"
# image_width: "640"
# image_height: "480"
# right_camera:
# image_types: ["color"]
# camera_type: "USB"
# video_device: "/dev/video4"
# image_width: "640"
# image_height: "480"

# # RealSense
# cameras:
# head_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
# left_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
# right_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"

demonstrate: true

default_action:
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
]
# [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,45 @@ _target_: robots.airbots.airbot_mmk.airbot_com_mmk2_bson.AIRBOTMMK2
ip: "localhost"

# NOTE: If you want to change the order of each part, be careful to change the order of each observation and action in the data conversion script simultaneously
components: ["left_arm", "left_arm_eef", "right_arm", "right_arm_eef"]
components: ["left_arm", "left_arm_eef", "right_arm", "right_arm_eef", "base"]

# USB cameras (only color image types)
cameras:
head_camera: ["color"]
# left_camera: ["color"]
# right_camera: ["color"]
head_camera:
image_types: ["color"]
camera_type: "USB"
video_device: "/dev/video0"
image_width: "640"
image_height: "480"
# left_camera:
# image_types: ["color"]
# camera_type: "USB"
# video_device: "/dev/video2"
# image_width: "640"
# image_height: "480"
# right_camera:
# image_types: ["color"]
# camera_type: "USB"
# video_device: "/dev/video4"
# image_width: "640"
# image_height: "480"

demonstrate: true
# # RealSense
# cameras:
# head_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
# left_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"
# right_camera:
# image_types: ["color"]
# camera_type: "REALSENSE"
# serial_no: "'123456'"
# rgb_camera.color_profile: "640,480,30"

default_action:
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
]
ignore_base_action: true

This file was deleted.

4 changes: 2 additions & 2 deletions configurations/task_configs/config_tools/basic_configer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def get_all_config(args: dict, stage: str):
# set start joint
if all_config.get("start_joint", None) is None:
init_states = get_init_states(all_config["load_data"], 0)
all_config["start_action"] = init_states[0]
all_config["start_joint"] = init_states[1]
all_config["start_joint"] = init_states[0]
all_config["start_action"] = init_states[1]
# set augmentors
all_config["load_data"]["augmentors"]["image"] = task_funcs["image_augmentor"]
all_config["augmentors_flag"] = {
Expand Down
151 changes: 3 additions & 148 deletions control_robot_bson.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

from habitats.common.robot_devices.cameras.utils import prepare_cv2_imshow

prepare_cv2_imshow()

import argparse
Expand Down Expand Up @@ -570,154 +571,8 @@ def stop_recording(self):
timestamp = 0
start_episode_t = time.perf_counter()
# Record one episode
bson_dict: Dict[str, Dict[str, list]] = {
"id": "734ad1c8-66ee-4479-b3cb-41d16c9b2e22",
"timestamp": 1734076528859,
"metadata": {
"driver_version": "1.0.0",
"operator": "manual",
"station_id": "3784D4BA-87AF-47E7-B86D-42CA1904AA77",
"task": "example",
"topics": {
"/action/head/joint_state": {
"description": "",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/action/spine/joint_state": {
"description": "",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/action/left_arm/joint_state": {
"description": "replay",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/action/left_arm_eef/joint_state": {
"description": "replay",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/action/right_arm/joint_state": {
"description": "replay",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/action/right_arm_eef/joint_state": {
"description": "replay",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
# "/action/eef/pose": {
# "description": "",
# "type": "jointstate",
# "sn": "",
# "firmware_version": "0.0.0",
# },
# "/action/base/joint_state": {
# "description": "slamtec-athena",
# "type": "jointstate",
# "sn": "",
# "firmware_version": "0.0.0",
# },
"/observation/head/joint_state": {
"description": "",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/observation/spine/joint_state": {
"description": "",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/observation/left_arm/joint_state": {
"description": "airbot-play-short",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/observation/right_arm/joint_state": {
"description": "airbot-play-short",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/observation/left_arm_eef/joint_state": {
"description": "airbot-play-short",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/observation/right_arm_eef/joint_state": {
"description": "airbot-play-short",
"type": "jointstate",
"sn": "",
"firmware_version": "0.0.0",
},
"/observation/left_arm/pose": {
"description": "",
"type": "pose",
},
"/observation/right_arm/pose": {
"description": "",
"type": "pose",
},
# "/observation/base/joint_state": {
# "description": "slamtec-athena",
# "type": "jointstate",
# "sn": "",
# "firmware_version": "0.0.0",
# },
"/images/head_camera": {
"description": "DSJ-2062-309",
"type": "image",
"width": 640,
"height": 480,
"encoding": "H264",
"distortion_model": None,
"distortion_params": None,
"intrinsics": None,
"fov": 120.0,
"start_time": 1733377253041,
},
# "/images/left_camera": {
# "description": "DSJ-2062-309",
# "type": "image",
# "width": 640,
# "height": 480,
# "encoding": "H264",
# "distortion_model": None,
# "distortion_params": None,
# "intrinsics": None,
# "fov": 120.0,
# "start_time": 1733377253041,
# },
# "/images/right_camera": {
# "description": "DSJ-2062-309",
# "type": "image",
# "width": 640,
# "height": 480,
# "encoding": "H264",
# "distortion_model": None,
# "distortion_params": None,
# "intrinsics": None,
# "fov": 120.0,
# "start_time": 1733377253041,
# },
},
"version": "1.2.1",
},
"data": {},
}
bson_dict: Dict[str, Dict[str, list]] = robot.bson_dict
robot.update_data_meta(bson_dict, robot.capture_observation())
while timestamp < episode_time_s:
start_loop_t = time.perf_counter()

Expand Down
Loading