Read constraints from the published URDF rather than hard code them.
Also make the webui more responsive for small screens.
This commit is contained in:
@@ -54,6 +54,7 @@ async def lifespan(app: FastAPI):
|
||||
node = start_ros()
|
||||
node.on_joint_states_callbacks.append(manager.broadcast_from_thread)
|
||||
node.on_ultrasonic_callbacks.append(manager.broadcast_from_thread)
|
||||
node.on_joint_limits_callbacks.append(manager.broadcast_from_thread)
|
||||
yield
|
||||
stop_ros()
|
||||
|
||||
@@ -65,6 +66,10 @@ app = FastAPI(lifespan=lifespan)
|
||||
async def websocket_endpoint(ws: WebSocket):
|
||||
await manager.connect(ws)
|
||||
node = get_node()
|
||||
# Send cached joint limits immediately so the client doesn't wait for the next publish
|
||||
cached_limits = node.get_joint_limits()
|
||||
if cached_limits:
|
||||
await ws.send_json({'type': 'joint_limits', 'limits': cached_limits})
|
||||
try:
|
||||
while True:
|
||||
data = await ws.receive_json()
|
||||
|
||||
Reference in New Issue
Block a user