- Host Configuration
- Runtime Node Configuration
- SDF Configuration
- Logfile Management
- Managing the Runtime
- Application Code Portability
- Building C Examples
- Building C++ Examples
- Building a Node
- Clone Example Repos
- Coordinate Frames
- Diagnostic Trouble Codes
- Extending the Data Model
- IDE Setup
- Logged vs Source vs Published Video Parameters
- MATLAB to Export - BETA
- PolySync Messages
- ROS Bridge
- Release Notes
- Standard Units
- Dynamic Driver/HW Interface Development
- Application Development
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.
$ echo $PSYNC_HOME /usr/local/polysync $ cd /usr/local/polysync $ source /opt/ros/jade/setup.bash $ pdm-gen -r modules/dtc/dtc.idl modules/sensor/sensor.idl modules/navigation/navigation.idl modules/control/control.idl <path-to-other-idl-files>
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 ps_file_transfer_ext_msg 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 ps_file_ext_msg 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.
$ source /usr/local/polysync/pdm/ros_bridge/setup.bash $ roscore $ polysync-core-manager $ rosrun polysync_ros_bridge BridgeNode -t ps_objects_msg ps_imu_msg 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.