Ejemplo n.º 1
0
func (m *DiagnosticStatus) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "byte", &m.Level); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.Name); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.Message); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.HardwareID); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Values)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Values {
		if err = ros.SerializeMessageField(w, "KeyValue", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 2
0
func (m *FollowJointTrajectoryGoal) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "trajectory_msgs/JointTrajectory", &m.Trajectory); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.PathTolerance)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.PathTolerance {
		if err = ros.SerializeMessageField(w, "JointTolerance", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.GoalTolerance)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.GoalTolerance {
		if err = ros.SerializeMessageField(w, "JointTolerance", &elem); err != nil {
			return err
		}
	}

	if err = ros.SerializeMessageField(w, "duration", &m.GoalTimeTolerance); err != nil {
		return err
	}

	return
}
Ejemplo n.º 3
0
Archivo: Joy.msg.go Proyecto: ppg/rosgo
func (m *Joy) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Axes)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Axes {
		if err = ros.SerializeMessageField(w, "float32", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Buttons)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Buttons {
		if err = ros.SerializeMessageField(w, "int32", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 4
0
func (m *FollowJointTrajectoryFeedback) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.JointNames)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.JointNames {
		if err = ros.SerializeMessageField(w, "string", &elem); err != nil {
			return err
		}
	}

	if err = ros.SerializeMessageField(w, "trajectory_msgs/JointTrajectoryPoint", &m.Desired); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "trajectory_msgs/JointTrajectoryPoint", &m.Actual); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "trajectory_msgs/JointTrajectoryPoint", &m.Error); err != nil {
		return err
	}

	return
}
Ejemplo n.º 5
0
func (m *Mesh) Serialize(w io.Writer) (err error) {
	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Triangles)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Triangles {
		if err = ros.SerializeMessageField(w, "MeshTriangle", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Vertices)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Vertices {
		if err = ros.SerializeMessageField(w, "geometry_msgs/Point", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 6
0
func (m *JointTrajectory) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.JointNames)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.JointNames {
		if err = ros.SerializeMessageField(w, "string", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Points)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Points {
		if err = ros.SerializeMessageField(w, "JointTrajectoryPoint", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 7
0
func (m *GridCells) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.CellWidth); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.CellHeight); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Cells)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Cells {
		if err = ros.SerializeMessageField(w, "geometry_msgs/Point", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 8
0
func (m *LaserScan) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.AngleMin); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.AngleMax); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.AngleIncrement); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.TimeIncrement); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.ScanTime); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.RangeMin); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float32", &m.RangeMax); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Ranges)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Ranges {
		if err = ros.SerializeMessageField(w, "float32", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Intensities)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Intensities {
		if err = ros.SerializeMessageField(w, "float32", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 9
0
func (m *TwistStamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Twist", &m.Twist); err != nil {
		return err
	}

	return
}
Ejemplo n.º 10
0
func (m *LookupTransformResult) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "geometry_msgs/TransformStamped", &m.Transform); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "tf2_msgs/TF2Error", &m.Error); err != nil {
		return err
	}

	return
}
Ejemplo n.º 11
0
func (m *AddTwoIntsRequest) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "int32", &m.A); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "int32", &m.B); err != nil {
		return err
	}

	return
}
Ejemplo n.º 12
0
func (m *GoalID) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "time", &m.Stamp); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.ID); err != nil {
		return err
	}

	return
}
Ejemplo n.º 13
0
func (m *TF2Error) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "uint8", &m.Error); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.ErrorString); err != nil {
		return err
	}

	return
}
Ejemplo n.º 14
0
func (m *Transform) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Vector3", &m.Translation); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Quaternion", &m.Rotation); err != nil {
		return err
	}

	return
}
Ejemplo n.º 15
0
func (m *GripperCommand) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "float64", &m.Position); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.MaxEffort); err != nil {
		return err
	}

	return
}
Ejemplo n.º 16
0
func (m *WrenchStamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Wrench", &m.Wrench); err != nil {
		return err
	}

	return
}
Ejemplo n.º 17
0
func (m *AccelStamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Accel", &m.Accel); err != nil {
		return err
	}

	return
}
Ejemplo n.º 18
0
func (m *Pose) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Point", &m.Position); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Quaternion", &m.Orientation); err != nil {
		return err
	}

	return
}
Ejemplo n.º 19
0
func (m *Twist) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Vector3", &m.Linear); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Vector3", &m.Angular); err != nil {
		return err
	}

	return
}
Ejemplo n.º 20
0
func (m *PoseWithCovarianceStamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "PoseWithCovariance", &m.Pose); err != nil {
		return err
	}

	return
}
Ejemplo n.º 21
0
func (m *KeyValue) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "string", &m.Key); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.Value); err != nil {
		return err
	}

	return
}
Ejemplo n.º 22
0
func (m *Vector3Stamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Vector3", &m.Vector); err != nil {
		return err
	}

	return
}
Ejemplo n.º 23
0
func (m *QuaternionStamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Quaternion", &m.Quaternion); err != nil {
		return err
	}

	return
}
Ejemplo n.º 24
0
func (m *Wrench) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Vector3", &m.Force); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Vector3", &m.Torque); err != nil {
		return err
	}

	return
}
Ejemplo n.º 25
0
func (m *SetBoolResponse) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "bool", &m.Success); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "string", &m.Message); err != nil {
		return err
	}

	return
}
Ejemplo n.º 26
0
func (m *InertiaStamped) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "Inertia", &m.Inertia); err != nil {
		return err
	}

	return
}
Ejemplo n.º 27
0
func (m *JointState) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Name)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Name {
		if err = ros.SerializeMessageField(w, "string", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Position)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Position {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Velocity)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Velocity {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Effort)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Effort {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 28
0
func (m *MultiDOFJointState) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "Header", &m.Header); err != nil {
		return err
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.JointNames)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.JointNames {
		if err = ros.SerializeMessageField(w, "string", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Transforms)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Transforms {
		if err = ros.SerializeMessageField(w, "geometry_msgs/Transform", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Twist)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Twist {
		if err = ros.SerializeMessageField(w, "geometry_msgs/Twist", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Wrench)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Wrench {
		if err = ros.SerializeMessageField(w, "geometry_msgs/Wrench", &elem); err != nil {
			return err
		}
	}

	return
}
Ejemplo n.º 29
0
func (m *JointTrajectoryPoint) Serialize(w io.Writer) (err error) {
	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Positions)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Positions {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Velocities)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Velocities {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Accelerations)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Accelerations {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	// Write size little endian
	err = binary.Write(w, binary.LittleEndian, uint32(len(m.Effort)))
	if err != nil {
		return fmt.Errorf("could not write array length: %s", err)
	}
	for _, elem := range m.Effort {
		if err = ros.SerializeMessageField(w, "float64", &elem); err != nil {
			return err
		}
	}

	if err = ros.SerializeMessageField(w, "duration", &m.TimeFromStart); err != nil {
		return err
	}

	return
}
Ejemplo n.º 30
0
func (m *Inertia) Serialize(w io.Writer) (err error) {
	if err = ros.SerializeMessageField(w, "float64", &m.M); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "geometry_msgs/Vector3", &m.Com); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.Ixx); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.Ixy); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.Ixz); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.Iyy); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.Iyz); err != nil {
		return err
	}

	if err = ros.SerializeMessageField(w, "float64", &m.Izz); err != nil {
		return err
	}

	return
}