Add support of Franka Panda robot and Zed camera (not fully tested)#2
Merged
Conversation
zbzhu99
reviewed
Sep 10, 2025
zbzhu99
left a comment
Contributor
There was a problem hiding this comment.
Can you use existing franka panda urdf under assets/franka_urdf?
zbzhu99
requested changes
Sep 10, 2025
zbzhu99
left a comment
Contributor
There was a problem hiding this comment.
Use existing franka panda urdf
zbzhu99
requested changes
Sep 11, 2025
Comment on lines
+22
to
+29
| DEBUG = True | ||
| if DEBUG: | ||
| import os | ||
| import shutil | ||
| if os.path.exists(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints-command-before-smoothing"): | ||
| shutil.rmtree(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints-command-before-smoothing") | ||
| if os.path.exists(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints-command-after-smoothing"): | ||
| shutil.rmtree(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints-command-after-smoothing") |
Contributor
There was a problem hiding this comment.
Remove all DEBUG code in gello.py
| ) | ||
| from maniunicon.core.policy import BasePolicy | ||
|
|
||
| from maniunicon.utils.data import get_next_episode_dir |
Contributor
There was a problem hiding this comment.
I have added recording logic and this is used now
| from multiprocessing.synchronize import Event | ||
| from loop_rate_limiters import RateLimiter | ||
| from scipy.spatial.transform import Rotation | ||
| from loguru import logger as lgr |
Comment on lines
+25
to
+31
| DEBUG = True | ||
| if DEBUG: | ||
| import os | ||
| import shutil | ||
| if os.path.exists(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints"): | ||
| shutil.rmtree(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints") | ||
| os.makedirs(f"/home/ydu/xiaoshen/franka_install/ManiUniCon/outputs/22222/joints", exist_ok=True) |
Contributor
There was a problem hiding this comment.
Remove all debug code and hardcode paths
| # max_relative_dynamics_factor = RelativeDynamicsFactor( | ||
| # velocity=0.99, acceleration=0.5, jerk=0.1 | ||
| # ) | ||
| motion = JointMotion(action.joint_positions,relative_dynamics_factor=max_relative_dynamics_factor) |
Contributor
There was a problem hiding this comment.
format the code using black
| self._is_connected = True | ||
| self._error_state = False | ||
|
|
||
| if self.config.get("use_ruckig", False): |
Contributor
There was a problem hiding this comment.
add comment to explain what ruckig is (add some links maybe) and clarify when the user should enable it.
Comment on lines
+1
to
+18
| import numpy as np | ||
| from collections import deque | ||
| from typing import Optional, List, Tuple | ||
| import time | ||
|
|
||
| class LowPassFilter: | ||
| def __init__(self, alpha, initial_value): | ||
| self.alpha = alpha | ||
| self.y = initial_value | ||
|
|
||
| def filter(self, x): | ||
| return x | ||
| self.y = self.alpha * x + (1 - self.alpha) * self.y | ||
| return self.y | ||
|
|
||
| class JointSpaceSmoother: | ||
| """ | ||
| Online smoother for robot control in joint space. |
Comment on lines
+1
to
+14
| from ruckig import InputParameter, OutputParameter, Result, Ruckig | ||
| import math | ||
| import numpy as np | ||
| import time | ||
|
|
||
| def init_ruckig(init_q: np.ndarray, init_dq: np.ndarray, DT: float) -> tuple[Ruckig, InputParameter, OutputParameter, Result]: | ||
| num_joints = init_q.shape[0] | ||
| otg = Ruckig(num_joints, DT) | ||
| otg_inp = InputParameter(num_joints) | ||
| otg_out = OutputParameter(num_joints) | ||
| otg_inp.max_velocity = 4 * [math.radians(80)] + 3 * [math.radians(140)] | ||
| # otg_inp.max_acceleration = 4 * [math.radians(240)] + 3 * [math.radians(450)] | ||
| otg_inp.current_position = init_q.copy() | ||
| otg_inp.current_velocity = init_dq.copy() |
| @@ -0,0 +1,274 @@ | |||
| #!/usr/bin/env python3 | |||
| """ | |||
| 相机标定程序 - 读取相机,计算内外参并保存 | |||
Comment on lines
+1
to
+19
| #!/usr/bin/env python3 | ||
| """ | ||
| Multi-camera point cloud real-time visualization program | ||
| Reads saved calibration results, transforms point clouds from any number of cameras to marker coordinate system, and visualizes them in real-time using meshcat | ||
| """ | ||
|
|
||
| import numpy as np | ||
| import argparse | ||
| import time | ||
| import threading | ||
| from pathlib import Path | ||
| from typing import List, Dict, Any | ||
|
|
||
| try: | ||
| import pyrealsense2 as rs | ||
| REALSENSE_AVAILABLE = True | ||
| except ImportError: | ||
| REALSENSE_AVAILABLE = False | ||
| print("Warning: pyrealsense2 not available.") |
zbzhu99
reviewed
Sep 11, 2025
Comment on lines
+7
to
+14
| class LowPassFilter: | ||
| def __init__(self, alpha, initial_value): | ||
| self.alpha = alpha | ||
| self.y = initial_value | ||
|
|
||
| def filter(self, x): | ||
| return x | ||
| self.y = self.alpha * x + (1 - self.alpha) * self.y | ||
| return self.y |
xshenhan
force-pushed
the
franka_dev
branch
from
September 12, 2025 05:46
f361d2c to
198fa21
Compare
add project root reformat .
xshenhan
force-pushed
the
franka_dev
branch
from
September 12, 2025 05:48
198fa21 to
3277c53
Compare
zbzhu99
approved these changes
Sep 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support of Franka Panda robot; Update readme