Skip to content

Add support of Franka Panda robot and Zed camera (not fully tested)#2

Merged
zbzhu99 merged 21 commits into
mainfrom
franka_dev
Sep 12, 2025
Merged

Add support of Franka Panda robot and Zed camera (not fully tested)#2
zbzhu99 merged 21 commits into
mainfrom
franka_dev

Conversation

@Ericonaldo

Copy link
Copy Markdown
Contributor

Add support of Franka Panda robot; Update readme

@zbzhu99 zbzhu99 self-assigned this Sep 10, 2025

@zbzhu99 zbzhu99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use existing franka panda urdf under assets/franka_urdf?

@zbzhu99 zbzhu99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use existing franka panda urdf

Comment thread maniunicon/policies/gello.py Outdated
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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all DEBUG code in gello.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

)
from maniunicon.core.policy import BasePolicy

from maniunicon.utils.data import get_next_episode_dir

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import is not used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added recording logic and this is used now

Comment thread maniunicon/core/robot.py Outdated
from multiprocessing.synchronize import Event
from loop_rate_limiters import RateLimiter
from scipy.spatial.transform import Rotation
from loguru import logger as lgr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format the code using black

self._is_connected = True
self._error_state = False

if self.config.get("use_ruckig", False):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format the code

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()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format

@@ -0,0 +1,274 @@
#!/usr/bin/env python3
"""
相机标定程序 - 读取相机,计算内外参并保存

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove Chinese comments

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.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format the code

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not implemented now?

add project root

reformat

.
@zbzhu99
zbzhu99 merged commit 825bf88 into main Sep 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants