sim2bot.Robot.move_to_pose¶
move_to_pose(position: Sequence[float], orientation: Optional[Sequence[float]] = None, robot: int = 0) -> None
¶
Command a Cartesian TCP target solved by in-browser inverse kinematics.
Parameters:
-
position(Sequence[float]) –World-frame
[x, y, z]in metres. -
orientation(Optional[Sequence[float]], default:None) –Optional world-frame quaternion
[x, y, z, w]. Omit it for position-only IK. -
robot(int, default:0) –Robot index returned by
describe.
Returns:
-
None–The pose target is sent to the browser IK controller.
Raises:
-
TypeError–If position or orientation is not an iterable of numbers.
-
ValueError–If a supplied component cannot be converted to
float. -
RuntimeError–If the client is not connected.
-
ConnectionClosed–If the WebSocket closes while sending the command.
-
OSError–If the selected transport cannot send the command.
Notes
The IK solution drives the same external target path as joint control.
Unreachable targets may settle at the closest configuration the solver
finds; verify RobotState.tcp before continuing.
Warning
IK does not imply a collision-free path and can choose a different joint configuration near singularities.
Examples:
Send a position-only target, then a full pose::
sim.move_to_pose([0.45, 0.0, 0.35])
sim.move_to_pose([0.45, 0.0, 0.35], [0.0, 0.0, 0.0, 1.0])
Source code in sim2bot/client.py
Practical examples¶
Examples use objects discovered from the current scene rather than hard-coded robot metadata.
Full six-degree-of-freedom pose
Verify the achieved TCP
Guidance¶
Usage tip
Omit orientation when position matters more than wrist attitude; it gives IK more freedom to find a solution.
Important behavior
IK can settle at the closest reachable pose and may choose a different joint configuration near singularities.
Common error
Quaternion order is [x, y, z, w], not [w, x, y, z].