rlightning.humanoid.utils.motion_viewer.robot_motion_viewer

class rlightning.humanoid.utils.motion_viewer.robot_motion_viewer.RobotMotionViewer(robot_config, motion_path: str, rate_limit: bool = True, camera_follow: bool = True, transparent_robot: int = 0, record_video: bool = False, video_path: str = None, video_width: int = 640, video_height: int = 480, video_fps: float = 30.0, log_dir: str = './logs')[source]

Bases: object

close()[source]
property current_motion: str
property is_paused: bool
key_callback(key: str)[source]
reset(fps: float = 30.0)[source]
save_screenshot()[source]

Saving screenshot of current frame

set_paused(paused: bool)[source]
setup()[source]
step(human_motion_data=None, show_human_body_name=False, human_point_scale=0.1, human_pos_offset=MockModule('numpy.array'))[source]

by default visualize robot motion. also support visualize human motion by providing human_motion_data, to compare with robot motion.

human_motion_data is a dict of {“human body name”: (3d global translation, 3d global rotation)}.

if rate_limit is True, the motion will be visualized at the same rate as the motion data. else, the motion will be visualized as fast as possible.

rlightning.humanoid.utils.motion_viewer.robot_motion_viewer.draw_frame(pos, mat, v, size, joint_name=None, orientation_correction=scipy.spatial.transform.Rotation.from_euler, pos_offset=MockModule('numpy.array'))[source]
rlightning.humanoid.utils.motion_viewer.robot_motion_viewer.load_motion_data(motion_file, quat_order='xyzw')[source]