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

Golang ros.SerializeMessageField函数代码示例

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

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



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

示例1: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:30,代码来源:DiagnosticStatus.msg.go


示例2: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:33,代码来源:FollowJointTrajectoryGoal.msg.go


示例3: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:29,代码来源:Joy.msg.go


示例4: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:30,代码来源:FollowJointTrajectoryFeedback.msg.go


示例5: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:25,代码来源:Mesh.msg.go


示例6: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:29,代码来源:JointTrajectory.msg.go


示例7: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:26,代码来源:GridCells.msg.go


示例8: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:57,代码来源:LaserScan.msg.go


示例9: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:TwistStamped.msg.go


示例10: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:LookupTransformResult.msg.go


示例11: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:AddTwoInts.srv.go


示例12: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:GoalID.msg.go


示例13: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:TF2Error.msg.go


示例14: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:Transform.msg.go


示例15: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:GripperCommand.msg.go


示例16: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:WrenchStamped.msg.go


示例17: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:AccelStamped.msg.go


示例18: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:Pose.msg.go


示例19: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:Twist.msg.go


示例20: Serialize

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
}
开发者ID:ppg,项目名称:rosgo,代码行数:11,代码来源:PoseWithCovarianceStamped.msg.go



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Golang ffjson.Marshal函数代码示例发布时间:2022-05-28
下一篇:
Golang ros.DeserializeMessageField函数代码示例发布时间: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