Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with Libfranka.JointPositions #44

Open
vincentkeino opened this issue Jan 22, 2025 · 0 comments
Open

problem with Libfranka.JointPositions #44

vincentkeino opened this issue Jan 22, 2025 · 0 comments

Comments

@vincentkeino
Copy link

hi , thanks for releasing code! while i use libfranka control method in this way:

target_joint_positions = [0.0, -0.78539816, 0.0, -2.35619449, 0.0, 1.57079633, 1.57079633]

def motion_generator(state: RobotState, period: Duration) -> JointPositions:
global start_time
current_joint_positions = state.q
elapsed_time = time.time() - start_time
interpolation_ratio = min(elapsed_time / motion_duration, 1.0)
desired_joint_positions = current_joint_positions + interpolation_ratio * (
np.array(target_joint_positions) - np.array(current_joint_positions)
)
joint_positions = JointPositions(desired_joint_positions.tolist())
if elapsed_time >= motion_duration:
joint_positions.motion_finished = True
else:
joint_positions.motion_finished = False
return joint_positions

motion_duration = 5.0
start_time = time.time()

try:
print("Starting motion...")
robot.control(motion_generator)
except Exception as e:
print(f"Motion failed: {e}")
finally:
print("Stopping motion...")
robot.stop()

it remind me that:Motion failed: Unable to cast Python instance of type <class 'panda_py.libfranka.JointPositions'> to C++ type '?' (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)

could u help me ? i cannot fix it . thank you!!!!

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

No branches or pull requests

1 participant