Documentation ¶
Overview ¶
Generates Golang types from ROS2 message definitions
Index ¶
- Variables
- func GenerateGolangMessageTypes(c *Config, rootPath string, destPath string) error
- func GeneratePrimitives(c *Config, destFilePath string) error
- func GenerateROS2AllMessagesImporter(c *Config, destPathPkgRoot string) error
- func GenerateROS2ErrorTypes(rootPath, destFilePath string) error
- func RclgoRepoRootPath() string
- type Config
- type Metadata
- type ROS2Constant
- type ROS2ErrorType
- type ROS2Field
- type ROS2Message
- type ROS2Service
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{
RclgoImportPath: "github.com/TIERS/rclgo",
MessageModulePrefix: "github.com/TIERS/rclgo-msgs",
}
Functions ¶
func GeneratePrimitives ¶
func GenerateROS2ErrorTypes ¶
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 ROS2Constant ¶
type ROS2Constant struct { RosType string GoType string RosName string Value string Comment string PkgName string PkgIsLocal bool }
ROS2Constant is a message definition.
func ParseROS2MessageConstant ¶
func ParseROS2MessageConstant(capture map[string]string, ros2msg *ROS2Message) (*ROS2Constant, error)
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 map[string]bool }
ROS2Message is a message definition. https://design.ros2.org/articles/legacy_interface_definition.html Use ROS2MessageNew() to initialize the struct
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.