- Host Configuration
- Runtime Node Configuration
- SDF Configuration
- Managing the Runtime
- Logfile Management
- Application Development
- Dynamic Driver Development
- Ecosystem Tools
This bidirectional bridge enables PolySync message to be transcribed to ROS topics, and ROS topics to be transcribed to PolySync messages at runtime. PolySync provides a toolchain to build and run a ROS bridge node, which acts as a bridge between the PolySync bus and the ROS bus.
This bridge enables synchronized sensor data from PolySync Core to flow into existing ROS applications. Allowing you to take advantage of PolySync Core’s massive suite of supported sensors, providing submillisecond timing fidelity and no data-loss, while using existing ROS applications and software APIs to create autonomous vehicle algorithms.
Here’s an example of LiDAR, RADAR, and object data visualized in RVIS, streaming from the PolySync bus via the bridge.
The ROS bridge node can be generated against any PolySync Core data model using the PolySync provided
pdm-gen tool. Once the files are generated the ROS bridge node can be spun up to subscribe to data from the PolySync Core bus, which the ROS bridge node begins transcribing and republishing to the ROS bus.
1. Building the ROS bridge
pdm-gen tool takes in IDL files as input arguments. The IDL files define C-style structures which make a PolySync high level message, for example the
After sourcing the ROS environment, use the
pdm-gen tool and pass in the IDL files containing the message types that you want transcribed to ROS topics.
$ sudo su - # cd /usr/local/polysync/ # source /opt/ros/<ros version>/setup.bash # pdm-gen -c -r $PSYNC_HOME/modules/dtc/dtc.idl $PSYNC_HOME/modules/sensor/sensor.idl $PSYNC_HOME/modules/navigation/navigation.idl $PSYNC_HOME/modules/control/control.idl <path-to-other-idl-files> # exit $ source $PSYNC_HOME/pdm/ros_bridge/setup.sh
The command above will generate a ROS topic for every message type defined in the PolySync data model. Create and supply additional IDL files to generate ROS topics for your custom-defined message types.
pdm-gen tool creates all ROS resources (scripts, headers, libraries) along with a custom ROS topic for each PolySync message that’s defined within the data model IDL files.
The output directory is
./pdm, and the generated ROS resources are in
./pdm/ros_bridge/. You do not need to manually copy files out of the
2. Running the ROS bridge
rosrun polysync_ros_bridge BridgeNode -h Node Type is a required option all others are optional Options: Flag: Description: Default: -t Node Type -o PolySync Ok State Timing 1 -n Node Name Prefix ROS_Bridge -w Number of ROS Threads 1 -q ROS Queue Size 1 -p ROS Topic Prefix polysync -m Print available messages -h Prints help
A node type is equivalent to the message type name, for example
2.1 Enumerating available message types
The bridge node enumerates the supported messages that can be subscribed to on the PolySync side, and be translated to a complimentary ROS topic.
$ rosrun polysync_ros_bridge BridgeNode -m Available bridge messages are: ps_platform_cabin_report_msg ps_rnr_msg ps_file_transfer_msg ps_imu_accuracy_msg ps_parameters_msg ps_event_msg ps_platform_tire_pressure_report_msg ps_platform_motion_msg ps_radar_targets_msg ps_image_data_msg ps_platform_wheel_speed_report_msg psync_file_transfer_ext_msg_handler ps_objects_msg ps_platform_obd_msg ps_imu_msg ps_platform_suspension_report_msg ps_platform_surround_report_msg ps_zones_msg ps_gps_msg ps_file_msg ps_byte_array_msg ps_response_msg ps_lane_model_msg ps_platform_steering_report_msg ps_platform_throttle_report_msg ps_platform_brake_information_msg ps_traffic_sign_msg ps_lidar_points_msg ps_diagnostic_trace_msg ps_can_frame_msg ps_platform_steering_command_msg ps_platform_brake_report_msg ps_gps_accuracy_msg ps_platform_turn_signal_command_msg ps_sdf_state_msg psync-file-ext-msg-handler ps_platform_brake_command_msg ps_command_msg ps_manager_status_msg ps_platform_throttle_command_msg ps_platform_gear_command_msg ps_platform_cabin_ext_report_msg ps_platform_gear_report_msg ps_rnr_sessions_msg ps_platform_control_msg
2.2 Starting the bridge node
For each message type that needs to be transcribed from the PolySync bus to the ROS bus, pass in the
-t flag and the message names.
In a terminal
$ source $PSYNC_HOME/pdm/ros_bridge/setup.bash $ roscore
In a second terminal
$ source $PSYNC_HOME/pdm/ros_bridge/setup.bash $ polysync-core-manager $ rosrun polysync_ros_bridge BridgeNode -t ps_objects_msg ps_imu_msg ps_gps_msg
2017-04-06 16:20:36.04s DEBUG [ps_to_ros-] - build version 2.0.0-1490989689 2017-04-06 16:20:38.04s DEBUG [ps_to_ros-281475308541435] - created participant - GUID: 0x0001000013C755FB d(281475308541435) 2017-04-06 16:20:38.04s DEBUG [ps_to_ros-281475308541435] - message types visible to this node: 80 Spinning up a node of type: ps_objects_msg Spinning up a node of type: ps_imu_msg Spinning up a node of type: ps_gps_msg
3. Using the ROS bridge
To see an example of how to utilize the ROS bridge, see this example from the PolySync Core C++ GitHub repo.