sim2bot.Robot.move_to¶
move_to(q: Sequence[float], robot: int = 0) -> None
¶
Send a joint-position target to one robot.
Parameters:
-
q(Sequence[float]) –Joint positions in radians, ordered exactly like
RobotInfo.joint_names. Normally supplydofvalues. -
robot(int, default:0) –Robot index returned by
describe.
Returns:
-
None–The target is sent asynchronously to the simulator.
Raises:
-
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 command is latest-writer-wins. In physics mode the robot's controller tracks the target; in kinematics-only mode it is applied directly. Sending a new joint, velocity, TCP, stop, reset, or trajectory command replaces the prior external motion mode.
Warning
Use discovered limits and a model-appropriate trajectory. This method does not plan around collisions or guarantee a safe path.
Examples:
Move the first discovered robot to its model-defined home::
arm = sim.describe()[0]
sim.move_to(arm.home, robot=arm.index)
Source code in sim2bot/client.py
Practical examples¶
Examples use objects discovered from the current scene rather than hard-coded robot metadata.
Change one joint without hard-coding DOF
Address two robots independently
Guidance¶
Usage tip
Build targets from discovered home or current state.q so the length and joint order stay correct.
Important behavior
This command does not plan around collisions or enforce a safe Cartesian path.
Common error
A target with the wrong joint count or order can move unexpected joints. Never assume every arm has seven joints.