Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions dimos/robot/unitree_webrtc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,17 @@ def start_background_loop():
self.connection_ready.wait()

def move(self, vector: Vector):
self.conn.datachannel.pub_sub.publish_without_callback(
RTC_TOPIC["WIRELESS_CONTROLLER"],
data={"lx": vector.x, "ly": vector.y, "rx": vector.z, "ry": 0},
)
# x - Positive right, negative left
# y - positive forward, negative backwards
# z - Positive rotate right, negative rotate left
async def async_move():
self.conn.datachannel.pub_sub.publish_without_callback(
RTC_TOPIC["WIRELESS_CONTROLLER"],
data={"lx": vector.x, "ly": vector.y, "rx": vector.z, "ry": 0},
)

future = asyncio.run_coroutine_threadsafe(async_move(), self.loop)
return future.result()

# Generic conversion of unitree subscription to Subject (used for all subs)
def unitree_sub_stream(self, topic_name: str):
Expand Down