当前位置: 首页>>代码示例>>Golang>>正文


Golang ros.DeserializeMessageField函数代码示例

本文整理汇总了Golang中github.com/ppg/rosgo/ros.DeserializeMessageField函数的典型用法代码示例。如果您正苦于以下问题:Golang DeserializeMessageField函数的具体用法?Golang DeserializeMessageField怎么用?Golang DeserializeMessageField使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DeserializeMessageField函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Deserialize

func (m *Mesh) Deserialize(r io.Reader) (err error) {
	// Triangles
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Triangles: %s", err)
		}
		m.Triangles = make([]MeshTriangle, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "MeshTriangle", &m.Triangles[i]); err != nil {
				return err
			}
		}
	}

	// Vertices
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Vertices: %s", err)
		}
		m.Vertices = make([]geometry_msgs.Point, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "geometry_msgs/Point", &m.Vertices[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:33,代码来源:Mesh.msg.go

示例2: Deserialize

func (m *GridCells) Deserialize(r io.Reader) (err error) {
	// Header
	if err = ros.DeserializeMessageField(r, "Header", &m.Header); err != nil {
		return err
	}

	// CellWidth
	if err = ros.DeserializeMessageField(r, "float32", &m.CellWidth); err != nil {
		return err
	}

	// CellHeight
	if err = ros.DeserializeMessageField(r, "float32", &m.CellHeight); err != nil {
		return err
	}

	// Cells
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Cells: %s", err)
		}
		m.Cells = make([]geometry_msgs.Point, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "geometry_msgs/Point", &m.Cells[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:33,代码来源:GridCells.msg.go

示例3: Deserialize

func (m *MapMetaData) Deserialize(r io.Reader) (err error) {
	// MapLoadTime
	if err = ros.DeserializeMessageField(r, "time", &m.MapLoadTime); err != nil {
		return err
	}

	// Resolution
	if err = ros.DeserializeMessageField(r, "float32", &m.Resolution); err != nil {
		return err
	}

	// Width
	if err = ros.DeserializeMessageField(r, "uint32", &m.Width); err != nil {
		return err
	}

	// Height
	if err = ros.DeserializeMessageField(r, "uint32", &m.Height); err != nil {
		return err
	}

	// Origin
	if err = ros.DeserializeMessageField(r, "geometry_msgs/Pose", &m.Origin); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:MapMetaData.msg.go

示例4: Deserialize

func (m *OccupancyGrid) Deserialize(r io.Reader) (err error) {
	// Header
	if err = ros.DeserializeMessageField(r, "Header", &m.Header); err != nil {
		return err
	}

	// Info
	if err = ros.DeserializeMessageField(r, "MapMetaData", &m.Info); err != nil {
		return err
	}

	// Data
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Data: %s", err)
		}
		m.Data = make([]int8, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "int8", &m.Data[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:OccupancyGrid.msg.go

示例5: Deserialize

func (m *RegionOfInterest) Deserialize(r io.Reader) (err error) {
	// XOffset
	if err = ros.DeserializeMessageField(r, "uint32", &m.XOffset); err != nil {
		return err
	}

	// YOffset
	if err = ros.DeserializeMessageField(r, "uint32", &m.YOffset); err != nil {
		return err
	}

	// Height
	if err = ros.DeserializeMessageField(r, "uint32", &m.Height); err != nil {
		return err
	}

	// Width
	if err = ros.DeserializeMessageField(r, "uint32", &m.Width); err != nil {
		return err
	}

	// DoRectify
	if err = ros.DeserializeMessageField(r, "bool", &m.DoRectify); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:RegionOfInterest.msg.go

示例6: Deserialize

func (m *InteractiveMarkerInit) Deserialize(r io.Reader) (err error) {
	// ServerID
	if err = ros.DeserializeMessageField(r, "string", &m.ServerID); err != nil {
		return err
	}

	// SeqNum
	if err = ros.DeserializeMessageField(r, "uint64", &m.SeqNum); err != nil {
		return err
	}

	// Markers
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Markers: %s", err)
		}
		m.Markers = make([]InteractiveMarker, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "InteractiveMarker", &m.Markers[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:InteractiveMarkerInit.msg.go

示例7: Deserialize

func (m *AccelWithCovariance) Deserialize(r io.Reader) (err error) {
	// Accel
	if err = ros.DeserializeMessageField(r, "Accel", &m.Accel); err != nil {
		return err
	}

	// Covariance
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Covariance: %s", err)
		}
		if size > 36 {
			return fmt.Errorf("array size for Covariance too large: expected=36, got=%d", size)
		}
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "float64", &m.Covariance[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:25,代码来源:AccelWithCovariance.msg.go

示例8: Deserialize

func (m *MenuEntry) Deserialize(r io.Reader) (err error) {
	// ID
	if err = ros.DeserializeMessageField(r, "uint32", &m.ID); err != nil {
		return err
	}

	// ParentID
	if err = ros.DeserializeMessageField(r, "uint32", &m.ParentID); err != nil {
		return err
	}

	// Title
	if err = ros.DeserializeMessageField(r, "string", &m.Title); err != nil {
		return err
	}

	// Command
	if err = ros.DeserializeMessageField(r, "string", &m.Command); err != nil {
		return err
	}

	// CommandType
	if err = ros.DeserializeMessageField(r, "uint8", &m.CommandType); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:MenuEntry.msg.go

示例9: Deserialize

func (m *CompressedImage) Deserialize(r io.Reader) (err error) {
	// Header
	if err = ros.DeserializeMessageField(r, "Header", &m.Header); err != nil {
		return err
	}

	// Format
	if err = ros.DeserializeMessageField(r, "string", &m.Format); err != nil {
		return err
	}

	// Data
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Data: %s", err)
		}
		m.Data = make([]uint8, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "uint8", &m.Data[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:CompressedImage.msg.go

示例10: Deserialize

func (m *SmachContainerInitialStatusCmd) Deserialize(r io.Reader) (err error) {
	// Path
	if err = ros.DeserializeMessageField(r, "string", &m.Path); err != nil {
		return err
	}

	// InitialStates
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for InitialStates: %s", err)
		}
		m.InitialStates = make([]string, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "string", &m.InitialStates[i]); err != nil {
				return err
			}
		}
	}

	// LocalData
	if err = ros.DeserializeMessageField(r, "string", &m.LocalData); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:SmachContainerInitialStatusCmd.msg.go

示例11: Deserialize

func (m *PointHeadGoal) Deserialize(r io.Reader) (err error) {
	// Target
	if err = ros.DeserializeMessageField(r, "geometry_msgs/PointStamped", &m.Target); err != nil {
		return err
	}

	// PointingAxis
	if err = ros.DeserializeMessageField(r, "geometry_msgs/Vector3", &m.PointingAxis); err != nil {
		return err
	}

	// PointingFrame
	if err = ros.DeserializeMessageField(r, "string", &m.PointingFrame); err != nil {
		return err
	}

	// MinDuration
	if err = ros.DeserializeMessageField(r, "duration", &m.MinDuration); err != nil {
		return err
	}

	// MaxVelocity
	if err = ros.DeserializeMessageField(r, "float64", &m.MaxVelocity); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:28,代码来源:PointHeadGoal.msg.go

示例12: Deserialize

func (m *MagneticField) Deserialize(r io.Reader) (err error) {
	// Header
	if err = ros.DeserializeMessageField(r, "Header", &m.Header); err != nil {
		return err
	}

	// MagneticField
	if err = ros.DeserializeMessageField(r, "geometry_msgs/Vector3", &m.MagneticField); err != nil {
		return err
	}

	// MagneticFieldCovariance
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for MagneticFieldCovariance: %s", err)
		}
		if size > 9 {
			return fmt.Errorf("array size for MagneticFieldCovariance too large: expected=9, got=%d", size)
		}
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "float64", &m.MagneticFieldCovariance[i]); err != nil {
				return err
			}
		}
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:30,代码来源:MagneticField.msg.go

示例13: Deserialize

func (m *MultiDOFJointTrajectoryPoint) Deserialize(r io.Reader) (err error) {
	// Transforms
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Transforms: %s", err)
		}
		m.Transforms = make([]geometry_msgs.Transform, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "geometry_msgs/Transform", &m.Transforms[i]); err != nil {
				return err
			}
		}
	}

	// Velocities
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Velocities: %s", err)
		}
		m.Velocities = make([]geometry_msgs.Twist, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "geometry_msgs/Twist", &m.Velocities[i]); err != nil {
				return err
			}
		}
	}

	// Accelerations
	{
		// Read size little endian
		var size uint32
		if err = binary.Read(r, binary.LittleEndian, &size); err != nil {
			return fmt.Errorf("cannot read array size for Accelerations: %s", err)
		}
		m.Accelerations = make([]geometry_msgs.Twist, int(size))
		for i := 0; i < int(size); i++ {
			if err = ros.DeserializeMessageField(r, "geometry_msgs/Twist", &m.Accelerations[i]); err != nil {
				return err
			}
		}
	}

	// TimeFromStart
	if err = ros.DeserializeMessageField(r, "duration", &m.TimeFromStart); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:53,代码来源:MultiDOFJointTrajectoryPoint.msg.go

示例14: Deserialize

func (m *Wrench) Deserialize(r io.Reader) (err error) {
	// Force
	if err = ros.DeserializeMessageField(r, "Vector3", &m.Force); err != nil {
		return err
	}

	// Torque
	if err = ros.DeserializeMessageField(r, "Vector3", &m.Torque); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:13,代码来源:Wrench.msg.go

示例15: Deserialize

func (m *SetBoolResponse) Deserialize(r io.Reader) (err error) {
	// Success
	if err = ros.DeserializeMessageField(r, "bool", &m.Success); err != nil {
		return err
	}

	// Message
	if err = ros.DeserializeMessageField(r, "string", &m.Message); err != nil {
		return err
	}

	return
}
开发者ID:ppg,项目名称:rosgo,代码行数:13,代码来源:SetBool.srv.go


注:本文中的github.com/ppg/rosgo/ros.DeserializeMessageField函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。