Documentation ¶
Overview ¶
Generates Golang types from ROS2 message definitions
Index ¶
- Variables
- func PrintErr(a ...any)
- func PrintErrf(format string, a ...any)
- func PrintErrln(a ...any)
- func RclgoRepoRootPath() string
- type Config
- type Generator
- func (g *Generator) GenerateCGOFlags() error
- func (g *Generator) GenerateGolangMessageTypes() error
- func (g *Generator) GeneratePrimitives() error
- func (g *Generator) GenerateROS2AllMessagesImporter() error
- func (g *Generator) GenerateROS2ErrorTypes() error
- func (g *Generator) GenerateRclgoFlags() error
- func (g *Generator) GenerateTestGogenFlags() error
- type Metadata
- type ROS2Action
- type ROS2Constant
- type ROS2ErrorType
- type ROS2Field
- type ROS2Message
- type ROS2Service
- type Rule
- type RuleSet
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{
RclgoImportPath: "github.com/merlindrones/rclgo",
MessageModulePrefix: "github.com/merlindrones/rclgo-msgs",
}
Functions ¶
func PrintErrln ¶
func PrintErrln(a ...any)
func RclgoRepoRootPath ¶
func RclgoRepoRootPath() string
RclgoRepoRootPath returns the path to the root of the rclgo repository. Panics if the path can't be determined.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func (*Generator) GenerateCGOFlags ¶
func (*Generator) GenerateGolangMessageTypes ¶
func (*Generator) GeneratePrimitives ¶
func (*Generator) GenerateROS2AllMessagesImporter ¶
func (*Generator) GenerateROS2ErrorTypes ¶
func (*Generator) GenerateRclgoFlags ¶
func (*Generator) GenerateTestGogenFlags ¶
type ROS2Action ¶
type ROS2Action struct { *Metadata Goal *ROS2Message Result *ROS2Message Feedback *ROS2Message SendGoal *ROS2Service GetResult *ROS2Service FeedbackMessage *ROS2Message }
func NewROS2Action ¶
func NewROS2Action(pkg, name string) *ROS2Action
type ROS2Constant ¶
type ROS2Constant struct { RosType string GoType string RosName string Value string Comment string PkgName string PkgIsLocal bool }
ROS2Constant is a message definition.
func (*ROS2Constant) GoPkgReference ¶
func (t *ROS2Constant) GoPkgReference() string
type ROS2ErrorType ¶
type ROS2ErrorType struct { Name string Rcl_ret_t string // The function call return value the error is mapped to Reference string // This is a reference to another type, so we just redefine the same type with another name Comment string // Any found comments before or over the #definition }
ROS2ErrorType must have fields exported otherwise they cannot be used by the test/template -package
type ROS2Field ¶
type ROS2Field struct { TypeArray string ArrayBounded string ArraySize int DefaultValue string PkgName string GoPkgName string PkgIsLocal bool RosType string CType string GoType string RosName string CName string GoName string Comment string }
Field is a message field.
func (*ROS2Field) GoPkgReference ¶
func (*ROS2Field) IsSingleComplex ¶
type ROS2Message ¶
type ROS2Message struct { *Metadata Fields []*ROS2Field Constants []*ROS2Constant GoImports map[string]string CImports stringSet }
ROS2Message is a message definition. https://design.ros2.org/articles/legacy_interface_definition.html Use ROS2MessageNew() to initialize the struct
func ParseMessage ¶
func ParseMessage(config *Config, content string) (*ROS2Message, error)
func ROS2MessageNew ¶
func ROS2MessageNew(pkg, name string) *ROS2Message
type ROS2Service ¶
type ROS2Service struct { *Metadata Request *ROS2Message Response *ROS2Message }
func NewROS2Service ¶
func NewROS2Service(pkg, name string) *ROS2Service
Click to show internal directories.
Click to hide internal directories.