test_connection.py
Robotaxi-OperatingSystem-Hardware-Interfaces/fmc3-robotics-main/projects/RoboSkill/fmc3-robotics/fourier/gr2/test_connection.py
import time
import sys
from fourier_aurora_client import AuroraClient
DOMAIN_ID = 123
ROBOT_NAME = "gr2"
def test_connection():
print(f"🔄 Attempting to connect to robot '{ROBOT_NAME}' on domain {DOMAIN_ID}...")
try:
client = AuroraClient.get_instance(domain_id=DOMAIN_ID, robot_name=ROBOT_NAME)
print("✅ Client instance created.")
except Exception as e:
print(f"❌ Failed to create client: {e}")
return
print("⏳ Waiting 3 seconds for discovery...")
time.sleep(3)
try:
# Try to read state
pos = client.get_group_state("right_manipulator")
print(f"📊 Current Right Arm Position: {pos}")
if pos is None:
print("⚠️ Position is None. Robot might not be publishing state.")
print(" Possible causes:")
print(" 1. Network interface mismatch (DDS is using the wrong WiFi/Ethernet adapter)")
print(" 2. Robot is powered off")
print(" 3. Firewall blocking UDP multicast")
else:
# Check if values are all zeros (common issue with uninitialized DDS)
if all(v == 0.0 for v in pos):
print("⚠️ Position is all zeros. This often indicates no actual data received.")
else:
print("✅ Valid data received! Connection is working.")
except Exception as e:
print(f"❌ Error reading state: {e}")
if __name__ == "__main__":
test_connection()
Articles liés
alloc.c
alloc.c — c source code from the Robotaxi-OperatingSystem-Hardware-Interfaces learning materials (Robotaxi-OperatingSystem-Hardware-Interfaces/class001_bundle/alloc.c).
Lire l'article →hello.c
hello.c — c source code from the Robotaxi-OperatingSystem-Hardware-Interfaces learning materials (Robotaxi-OperatingSystem-Hardware-Interfaces/class001_bundle/hello.c).
Lire l'article →mlock_demo.c
mlock_demo.c — c source code from the Robotaxi-OperatingSystem-Hardware-Interfaces learning materials (Robotaxi-OperatingSystem-Hardware-Interfaces/class001_bundle/mlock_demo.c).
Lire l'article →debug_perf.py
debug_perf.py — python source code from the Robotaxi-OperatingSystem-Hardware-Interfaces learning materials (Robotaxi-OperatingSystem-Hardware-Interfaces/fmc3-robotics-main/projects/RoboBrain2.0/debug_perf.py).
Lire l'article →inference.py
inference.py — python source code from the Robotaxi-OperatingSystem-Hardware-Interfaces learning materials (Robotaxi-OperatingSystem-Hardware-Interfaces/fmc3-robotics-main/projects/RoboBrain2.0/inference.py).
Lire l'article →startup.sh
startup.sh — bash source code from the Robotaxi-OperatingSystem-Hardware-Interfaces learning materials (Robotaxi-OperatingSystem-Hardware-Interfaces/fmc3-robotics-main/projects/RoboBrain2.0/startup.sh).
Lire l'article →