sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
bridge_lag_monitor Namespace Reference

Functions

 main ()

Detailed Description

# Copyright (c) 2012-2026 Murilo Marques Marinho
#
#    This file is part of sas_robot_driver_gazebo.
#
#    sas_robot_driver_gazebo is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Lesser General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    sas_robot_driver_gazebo is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU Lesser General Public License for more details.
#
#    You should have received a copy of the GNU Lesser General Public License
#    along with sas_robot_driver_gazebo.  If not, see <https://www.gnu.org/licenses/>.
#
# #######################################################################################
#
#   Author: Murilo M. Marinho, email: murilomarinho@ieee.org
#
# #######################################################################################
#   Contributor: Claude (Anthropic)
# #######################################################################################

@file bridge_lag_monitor.py
@brief How late a robot driver bridge reports Gazebo's joint positions.

Samples, at 50 Hz, the joint positions Gazebo publishes (gz-transport, the
JointStatePublisher topic) and those the bridge reports
(`robot_name/get/joint_states`), then prints the delay that best aligns them
and the largest gap. The Gazebo subscription is throttled and the ROS spin
waits, so that this monitor does not fall behind itself.

The delay is the smallest shift that aligns the two series within a small
tolerance of the best alignment. With periodic motion, delays that differ by
a whole period cannot be told apart: the smallest one is reported.

    ros2 run sas_robot_driver_gazebo bridge_lag_monitor.py \
        /world/ur3e_world/model/ur3e/model/ur3e_position_controller/model/ur3e/joint_state \
        /ur3e_1/get/joint_states 45 shoulder_pan_joint shoulder_lift_joint elbow_joint \
        wrist_1_joint wrist_2_joint wrist_3_joint

Function Documentation

◆ main()

main ( )
@brief Sample both sides and print the delay and the largest gap.
@return None