Skip to content
James Edmondson edited this page Apr 3, 2020 · 4 revisions

TOOL AND FEATURE TEMPORARILY UNAVAILABLE

As of 1.3.0 of the GAMS middleware, ROS support is temporarily removed. With the removal of the Any type and capnproto, especially, in order to support Windows and UE4 builds, we have removed direct ROS support. You can still technically bridge GAMS and MADARA by creating new platforms that manipulate ROS directly, but there is no longer a functional rosbridge or ros2gams tool that translates between the standards implicitly. We do plan to readd this feature as soon as we have the time and manpower. It will just no longer use the Any type.

You can access these features in the final version of 1.2.2.


generate_schemas.py

Description:

Located in the gams/scripts/linux directory, this tool will translate ROS message definitions into .capnp definitions usable in a GAMS build. Simply run the tool and specify the output to be inside the src/gams/types directory for the .capnp files to be included in your libGAMS.so (if modifying it). If you feel there are types that should be in the GAMS standard, please make a pull request of the .capnp type into master. Note, not just ROS translated types can be accepted here. New types are welcome, but this tool was created primarily to help ROS users wishing to upgrade to a higher performance middleware.

Current supported inputs:

  • (--live) option to run against a system with a running ROS master. It will look at all of the topics and determine their types. From that it will generate a list of types (includes nested types) that it will generate .h and .cpp files from.

./generate_schemas.py --live -o ../../src/gams/types

  • (--rosbag) option to pass in a rosbag and doing the same as above.

./generate_schemas.py --rosbag robot.bag -o ../../src/gams/types

  • (--all) option to generate all types defined in your ROS package path. It will generate classes for every message type it finds. Useful for developers and getting things started. If you want a high performance system, smaller compile times, and no cycle waste, you will want to use a combination of these options to find all of the types on your ROS system.

./generate_schemas.py --all -o ../../src/gams/types

  • (--msg)

./generate_schemas.py --msg geometry_msgs/Point -o ../../src/gams/types

Current supported options:

  • (--blacklist) Pass in a list of ROS packages to ignore for datatype generation. Alternatively, a simple 'blacklist' file in the same directory as you are calling the script from will be read as the list of packages to blacklist. You may also use the name of the ROS message to whitelist if you want to select an individual type.

./generate_schemas.py --all --blacklist sensor_msgs -o ../../src/gams/types

This will generate .capnp files for all ROS messages except the sensor_msgs package

  • (--whitelist) Alternative to blacklist. A list of packages which will ONLY be looked at for type generation. If a whitelist file exists in the current directory as you are running this from. You may also use the name of the ROS message to whitelist if you want to select an individual type.

./generate_schemas.py --all --whitelist sensor_msgs -o ../../src/gams/types

This will generate only types for sensor_msgs and the types that are required to make those (it does it recusrively unless on the blacklist)

  • (--no-subtypes) This will prevent subtypes from being generated and only take into consideration the top level types.

Using the generated types:

Generally all you will need to do is include the Types.h header from <gams/types/Types.h> and call this at the beginning of your process:

gams::types::register_all_types();

All of the types will become registered and usable. To see exactly how to interface with them, (they are slightly different than the ROS definition interfaces but the idea is the same) see: https://github.com/jredmondson/madara/wiki/Custom-KnowledgeRecord-Types

Clone this wiki locally