Module: OroGen::TypekitMarshallers::ROS

Extended by:
Logger::Hierarchy
Defined in:
lib/orogen/marshallers/ros.rb

Defined Under Namespace

Modules: ArrayTypeExtension, CompoundTypeExtension, ContainerTypeExtension, OpaqueTypeExtension, TypeExtension Classes: Plugin

Constant Summary collapse

DEFAULT_BOXED_MSG_MAPPINGS =
Hash.new
DEFAULT_TYPE_TO_MSG =
Hash.new

Class Method Summary collapse

Class Method Details

.load_rosmap(path) ⇒ Hash<String,String>

Loads a rosmap file

These files are generated for each ROS transport. They contain the mapping from an oroGen type name to the corresponding ROS message name.

Returns:

  • (Hash<String,String>)

    mapping from the oroGen type name to the corresponding ROS message name



32
33
34
35
36
37
38
39
40
41
# File 'lib/orogen/marshallers/ros.rb', line 32

def self.load_rosmap(path)
    result = Hash.new
    File.readlines(path).each do |line|
        line = line.strip
        next if line.empty?
        type_name, ros_msg_name, ros_field_name = line.split(/\s+/)
        result[type_name] = ros_msg_name
    end
    result
end

.load_rosmap_by_package_name(name) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/orogen/marshallers/ros.rb', line 43

def self.load_rosmap_by_package_name(name)
    pkg = Utilrb::PkgConfig.new("#{name}-transport-ros-#{OroGen.orocos_target}")
    if pkg.rosmap
        load_rosmap(pkg.rosmap)
    else raise ArgumentError, "the oroGen project #{name} does not have a rosmap"
    end
end