\section remoterobot-start Starting a RobotStateComponent
The RobotState component serves as a central component for storing all robot related data. For now this data covers the current joint angles of the robot.<br>
The RobotStateComponent implements a KinematicUnitListener, hence it reacts on all joint updates that are reported by a KinematicUnit component. An exemplary startup script could look like this
\section remoterobot-access Accessing the RobotStateComponent
The RobotStateComponent provides several methods for accessing the current configuration of the robot and for getting a snapshot of the current state which is compatible with
models of the Simox/VirtualRobot framework. With these models the whole functionality of Simox (http://simox.sf.net) can be used, e.g. IK solving, collision detection or motion and grasp planning.
\par Creating a synchronized model (RemoteRobot)
A RemoteRobot is a synchronized robot data structure which always represents the current state of the robot.
Be aware, that any operations on this model (e.g. IK solving) may take long (e.g. 100 ms) due to the heavy network communication overhead.
For complex operations it is suggested to create a local clone of the data structure and to synchronize this clone before working with it (see below).
The Remote Robot can be created by getting the proxy to the RobotStateComponent and grabbing a RemoteRobot:
The remoteRobot object can now be accessed in order to get joint angles or to convert cooridnate frames.
\par Create a local robot and synchronize it by hand
When complex operations should be performed on a robot model the use of a RemoteRobot could slow down the computation since each joint access induces a network transfer.
Hence the RemoteRobot offers a method to create a local copy of the remote data.<br>
If only the structure of the robot is needed (without 3D models, useful e.g. for kinematic calculations, coorinate transformations, etc),
the following method can be used to create a local clone of the robot: