• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang ros.DeserializeMessageField函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Deserialize

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

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

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


示例17: Deserialize

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

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

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


示例18: Deserialize

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

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

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


示例19: Deserialize

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

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

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


示例20: Deserialize

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

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

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang ros.SerializeMessageField函数代码示例发布时间:2022-05-28
下一篇:
Golang kvdb.Kvdb类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap