Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertConstantValue(fieldType string, valueLiteral string) (interface{}, error)
- func FindAllActions(rosPkgPaths []string) (map[string]string, error)
- func FindAllMessages(rosPkgPaths []string) (map[string]string, error)
- func FindAllServices(rosPkgPaths []string) (map[string]string, error)
- func GenerateAction(context *PkgContext, spec *ActionSpec) (actionCode string, codeMap map[string]string, err error)
- func GenerateMessage(context *PkgContext, spec *MsgSpec, isAction bool) (string, error)
- func GenerateService(context *PkgContext, spec *SrvSpec) (string, string, string, error)
- func GetZeroValue(pkg string, typeName string) string
- func OptionPackageName(name string) func(*MsgSpec) error
- func OptionShortName(name string) func(*MsgSpec) error
- func PackageResourceName(name string) (string, string, error)
- func ToGoName(name string, constant bool) string
- func ToGoType(pkg string, typeName string) string
- type ActionCode
- type ActionSpec
- type BuiltInType
- type Constant
- type Field
- type MsgGen
- type MsgSpec
- type OptionMsgSpec
- type PkgContext
- func (ctx *PkgContext) ComputeActionMD5(spec *ActionSpec) (string, error)
- func (ctx *PkgContext) ComputeMD5Text(spec *MsgSpec) (string, error)
- func (ctx *PkgContext) ComputeMsgMD5(spec *MsgSpec) (string, error)
- func (ctx *PkgContext) ComputeSrvMD5(spec *SrvSpec) (string, error)
- func (ctx *PkgContext) GetActions() map[string]*ActionSpec
- func (ctx *PkgContext) GetMsgs() map[string]*MsgSpec
- func (ctx *PkgContext) GetSrvs() map[string]*SrvSpec
- func (ctx *PkgContext) LoadAction(fullname string) (*ActionSpec, error)
- func (ctx *PkgContext) LoadActionFromFile(filePath string, fullname string) (*ActionSpec, error)
- func (ctx *PkgContext) LoadActionFromString(text string, fullname string) (*ActionSpec, error)
- func (ctx *PkgContext) LoadMsg(fullname string) (*MsgSpec, error)
- func (ctx *PkgContext) LoadMsgFromFile(filePath string, fullname string) (*MsgSpec, error)
- func (ctx *PkgContext) LoadMsgFromString(text string, fullname string) (*MsgSpec, error)
- func (ctx *PkgContext) LoadSrv(fullname string) (*SrvSpec, error)
- func (ctx *PkgContext) LoadSrvFromFile(filePath string, fullname string) (*SrvSpec, error)
- func (ctx *PkgContext) LoadSrvFromString(text string, fullname string) (*SrvSpec, error)
- func (ctx *PkgContext) RegisterAction(fullname string, spec *ActionSpec)
- func (ctx *PkgContext) RegisterMsg(fullname string, spec *MsgSpec)
- func (ctx *PkgContext) RegisterSrv(fullname string, spec *SrvSpec)
- type ROSPackage
- type SrvSpec
- type SyntaxError
Constants ¶
View Source
const ( HeaderType = "Header" TimeType = "time" DurationType = "duration" HeaderFullName = "std_msgs/Header" TimeMsg = "uint32 secs\nuint32 nsecs" DurationMsg = "uint32 secs\nuint32 nsecs" )
View Source
const ( Sep = "/" MsgDir = "msg" SrvDir = "srv" ExtMsg = ".msg" ExtSrv = ".msg" ConstChar = "=" CommentChar = "#" IoDelim = "---" )
Variables ¶
View Source
var BaseResourceNameLegalCharsPattern = regexp.MustCompile(`"[A-Za-z][\w_]*$`)
View Source
var BuiltinTypes = append([]string{TimeType, DurationType}, PrimitiveTypes...)
View Source
var PrimitiveTypes = []string{
"int8",
"uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64", "float32", "float64",
"string",
"bool",
"char", "byte",
}
View Source
var ResourceNameLegalCharsPattern = regexp.MustCompile(`^[A-Za-z][\w_\/]*$`)
Functions ¶
func ConvertConstantValue ¶
func GenerateAction ¶
func GenerateAction(context *PkgContext, spec *ActionSpec) (actionCode string, codeMap map[string]string, err error)
func GenerateMessage ¶
func GenerateMessage(context *PkgContext, spec *MsgSpec, isAction bool) (string, error)
func GenerateService ¶
func GetZeroValue ¶
func OptionPackageName ¶
func OptionShortName ¶
Types ¶
type ActionCode ¶
type ActionCode struct {
// contains filtered or unexported fields
}
type ActionSpec ¶
type BuiltInType ¶
type BuiltInType int
BuiltInType enumeration represents a standard ros type. See http://wiki.ros.org/msg for specification.
const ( Invalid BuiltInType = iota Bool Int8 Int16 Int32 Int64 Uint8 Uint16 Uint32 Uint64 Float32 Float64 String Time Duration )
Enumeration of all ros builtin types. Invalid represents a non-built in type.
func ToBuiltInType ¶
func ToBuiltInType(typeName string) BuiltInType
type Constant ¶
func NewConstant ¶
type Field ¶
type Field struct { Package string Type string Name string IsBuiltin bool BuiltInType BuiltInType IsArray bool ArrayLen int GoName string GoType string ZeroValue string }
type MsgSpec ¶
type MsgSpec struct { Fields []Field Constants []Constant Text string MD5Sum string FullName string ShortName string Package string }
func NewMsgSpec ¶
type OptionMsgSpec ¶
type PkgContext ¶
type PkgContext struct {
// contains filtered or unexported fields
}
func NewPkgContext ¶
func NewPkgContext(rosPkgPaths []string) (*PkgContext, error)
func (*PkgContext) ComputeActionMD5 ¶
func (ctx *PkgContext) ComputeActionMD5(spec *ActionSpec) (string, error)
func (*PkgContext) ComputeMD5Text ¶
func (ctx *PkgContext) ComputeMD5Text(spec *MsgSpec) (string, error)
func (*PkgContext) ComputeMsgMD5 ¶
func (ctx *PkgContext) ComputeMsgMD5(spec *MsgSpec) (string, error)
func (*PkgContext) ComputeSrvMD5 ¶
func (ctx *PkgContext) ComputeSrvMD5(spec *SrvSpec) (string, error)
func (*PkgContext) GetActions ¶
func (ctx *PkgContext) GetActions() map[string]*ActionSpec
func (*PkgContext) GetMsgs ¶
func (ctx *PkgContext) GetMsgs() map[string]*MsgSpec
func (*PkgContext) GetSrvs ¶
func (ctx *PkgContext) GetSrvs() map[string]*SrvSpec
func (*PkgContext) LoadAction ¶
func (ctx *PkgContext) LoadAction(fullname string) (*ActionSpec, error)
func (*PkgContext) LoadActionFromFile ¶
func (ctx *PkgContext) LoadActionFromFile(filePath string, fullname string) (*ActionSpec, error)
func (*PkgContext) LoadActionFromString ¶
func (ctx *PkgContext) LoadActionFromString(text string, fullname string) (*ActionSpec, error)
func (*PkgContext) LoadMsgFromFile ¶
func (ctx *PkgContext) LoadMsgFromFile(filePath string, fullname string) (*MsgSpec, error)
func (*PkgContext) LoadMsgFromString ¶
func (ctx *PkgContext) LoadMsgFromString(text string, fullname string) (*MsgSpec, error)
func (*PkgContext) LoadSrvFromFile ¶
func (ctx *PkgContext) LoadSrvFromFile(filePath string, fullname string) (*SrvSpec, error)
func (*PkgContext) LoadSrvFromString ¶
func (ctx *PkgContext) LoadSrvFromString(text string, fullname string) (*SrvSpec, error)
func (*PkgContext) RegisterAction ¶
func (ctx *PkgContext) RegisterAction(fullname string, spec *ActionSpec)
func (*PkgContext) RegisterMsg ¶
func (ctx *PkgContext) RegisterMsg(fullname string, spec *MsgSpec)
func (*PkgContext) RegisterSrv ¶
func (ctx *PkgContext) RegisterSrv(fullname string, spec *SrvSpec)
type ROSPackage ¶
type ROSPackage struct {
Name string `xml:"name"`
}
type SyntaxError ¶
func NewSyntaxError ¶
func NewSyntaxError(fullName string, line int, message string) *SyntaxError
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
Click to show internal directories.
Click to hide internal directories.