====== EZPhysics Network Protocol ====== EZPhysics provides a network interface for sending and receiving data from the ODE simulation. This is done through predefined packets. This page lists what these packages contain and in what order (has determined in //EZNetwork// class, at //EZPhysicsNetwork.cpp//). An EZPhysics Network Message has the following format: {{ :network_protocol.png?800 |}} ===== Send Packets ===== Send Packets refers to the packets sent from EZPhysics, which contain the latest simulation's data. === EZNETWORK_SEND_COLLISION 01 === Usually sent in pairs, refers to the point of contact between two Body's. - Float X of the contact point - Float Y of the contact point - Float Z of the contact point - Float depth (penetration of the collision) === EZNETWORK_SEND_LIMB 02 === A Body's output. - Float X of the position vector - Float Y of the position vector - Float Z of the position vector - Float W of the rotation quaternion - Float X of the rotation quaternion - Float Y of the rotation quaternion - Float Z of the rotation quaternion - Float X of the force vector - Float Y of the force vector - Float Z of the force vector - Float X of the torque vector - Float Y of the torque vector - Float Z of the torque vector - Float Unused - Float X of the linear velocity vector - Float Y of the linear velocity vector - Float Z of the linear velocity vector - Float X of the angular velocity vector - Float Y of the angular velocity vector - Float Z of the angular velocity vector - Float Unused === EZNETWORK_SEND_JOINTAXIS 03 === Refers to each of the possibly several axis of a Joint. - Float displacement value of the axis (Relevant for the Slider Joint) - Float angular velocity at the axis === EZNETWORK_SEND_JOINTFEEDBACK 04 === The feedback can be used by the user, so that it is known how much force an individual joint exerts. - Float X of the force vector of body 1 - Float Y of the force vector of body 1 - Float Z of the force vector of body 1 - Float X of the torque vector of body 1 - Float Y of the torque vector of body 1 - Float Z of the torque vector of body 1 - Float X of the force vector of body 2 - Float Y of the force vector of body 2 - Float Z of the force vector of body 2 - Float X of the torque vector of body 2 - Float Y of the torque vector of body 2 - Float Z of the torque vector of body 2 === EZNETWORK_SEND_TIMESTAMP 05 === Can be used to determine the current time of simulation. - Long ODE step number (since the beginning of the simulation) - Float ODE step size ===== Receive Packets ===== Receive Packets refers to the packets received in EZPhysics, which contain the control commands to apply in the simulation. === EZNETWORK_RECV_RESET 01 === Commands the simulation to restart. === EZNETWORK_RECV_AXIS_FORCE 02 === Represents a raw torque applied in an axis. - Float torque value to apply to the axis 1 of a Joint - Float torque value to apply to the axis 2 of a Joint (May be invalid) - Float torque value to apply to the axis 3 of a Joint (May be invalid) === EZNETWORK_RECV_AXIS_MOTOR 03 === Provides a common servo motor interface, target velocity and maximum torque. - Float target velocity to apply on axis 1 of a Joint - Float maximum torque imposed on axis 1 of a Joint - Float target velocity to apply on axis 2 of a Joint (May be invalid) - Float maximum torque imposed on axis 2 of a Joint (May be invalid) - Float target velocity to apply on axis 3 of a Joint (May be invalid) - Float maximum torque imposed on axis 3 of a Joint (May be invalid)