Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter to os_cloud_node to control the sensor frames publishing #153

Open
wants to merge 1 commit into
base: ros2
Choose a base branch
from

Conversation

abAgriRobot
Copy link

@abAgriRobot abAgriRobot commented Jun 20, 2023

Related Issues & PRs

Summary of Changes

By default the os_cloud_node publishes the static transformation for the sensor_frame, lidar_frame and imu_frame.
In some cases this transformations are defined in a higher level URDF file, and having the node publishing the frames may create conflicts in the tf tree.
We added a parameter to control if the node publishes the frames.

    ros__parameters:
        sensor_frame: 'os_sensor'
        lidar_frame: 'os_lidar'
        imu_frame: 'os_imu'
        timestamp_mode: "TIME_FROM_ROS_TIME" # this value needs to match os_sensor/timestamp_mode
        publish_sensor_frames: True

The parameter defaults to True so the behavior of the node doen't change unless explicitly define

       publish_sensor_frames: False

Validation

@Samahu Samahu self-requested a review June 20, 2023 15:34
@Samahu Samahu self-assigned this Jun 20, 2023
@Samahu
Copy link
Contributor

Samahu commented Jun 20, 2023 via email

@abAgriRobot
Copy link
Author

The pointcloud and imu data use the defined frames as frame_id, renaming them would cause the data to be published in the wrong frame.

My config file looks similar to this:

ros__parameters:
        sensor_frame: 'my_vehicle_lidar_front/laser'
        lidar_frame: 'my_vehicle_lidar_front'
        imu_frame: 'my_vehicle_lidar_front/imu'
        timestamp_mode: "TIME_FROM_ROS_TIME" # this value needs to match os_sensor/timestamp_mode
        publish_sensor_frames: True

And I want the pointcloud data to have frame_id=my_vehicle_lidar_front/laser and the imu data frame_id=my_vehicle_lidar_front/imu. In the current version the node will do this and in addition will publish the static transforms
In our application, we define this frames in a higher level URDF since we still need them for simulation and replaying rosbag data. So the frames that the lidar need will be available and the node doesn't require to initialize them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants