Repository navigation
Create generalized proxy tool to forward messages - #448
Merged
Merged
Conversation
Added TCPBroadcastServerTransport, an output-only tcp://:PORT listener that sends to any number of simultaneously connected clients, dropping clients that disconnect or cannot keep up. create_transport() now returns it for tcp://:PORT when mode='output'. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Moved transform_pose_to_target() and transformed_pose_to_external_pose_input() out of the pose_relay.py example so they can be shared with other tools, and added unit tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
p1_proxy forwards raw wheel speed, vehicle speed, IMU, and pose output from a source device to one or more targets as the corresponding input messages. Pose is transformed for the target's lever arm and mounting, and optionally resets the target's position on the first pose (--reset-target-position). Targets that are unreachable or disconnect are retried without stopping the proxy, and tcp://:<port> targets accept any number of clients. Replaces the proxy_wheel_speed.py example. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| try: | ||
| assert not isinstance(t, TCPBroadcastServerTransport) | ||
| finally: | ||
| t.close() |
| import sys | ||
| import threading | ||
| import time | ||
| from typing import Callable, Dict, List, Optional, Set, Tuple, Type |
| from import_utils import enable_relative_imports | ||
| __package__ = enable_relative_imports(__name__, __file__) | ||
|
|
||
| from ..messages import * |
| from ..utils.pose_relay import transform_pose_to_target, transformed_pose_to_external_pose_input | ||
| from ..utils.time_provider import TimeProvider | ||
| from ..utils.trace import BrokenPipeStreamHandler, HighlightFormatter | ||
| from ..utils.transport_utils import * |
| from fusion_engine_client.utils.transport_utils import * | ||
| from fusion_engine_client.utils.bin_utils import bytes_to_hex | ||
| from fusion_engine_client.utils.pose_relay import transform_pose_to_target, transformed_pose_to_external_pose_input | ||
| from fusion_engine_client.utils.transport_utils import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Features
p1_proxy, which forwards raw wheel speed, vehicle speed, IMU, and pose output from a source device to one or more targets as the matching input messages.TCPBroadcastServerTransport, an output-only TCP server transport that sends to any number of connected clients. Clients can connect and disconnect at any time.tcp://:<port>target inp1_proxyaccepts any number of clients, and all of them receive the data.Changes
pose_relay.pyexample intoutils/pose_relay.pyso other tools can share them.proxy_wheel_speed.pyexample, whichp1_proxyreplaces.create_transport()now returns the new multi-client server transport fortcp://:<port>in output mode.