compas-dev / compas_fab

Robotic fabrication package for the COMPAS Framework.
https://compas.dev/compas_fab/
MIT License
108 stars 32 forks source link

Robot library remove old robots #407

Closed yck011522 closed 2 months ago

yck011522 commented 4 months ago

This depends on #406, we should review and merge #406 first before this one.

Removed compas_fab.robots.ur5 because it is now part of compas_fab.robots.RobotLibrary. Removed data files of ur5 and ur10e from src/compas_fab/data/universal_robots because they are now in of src/compas_fab/data/robot_library.

Future constructs should use:

from compas_fab.robots import RobotLibrary
robot = RobotLibrary.ur5(load_geometry=True)

Or from URDF and SRDF from scratch

urdf_filename = compas_fab.get("robot_library/ur5_robot/urdf/robot_description.urdf")
robot_model = RobotModel.from_urdf_file(urdf_filename )

mesh_loader = LocalPackageMeshLoader(compas_fab.get("robot_library/ur5_robot"), "")
robot_model.load_geometry(mesh_loader)

srdf_filename = compas_fab.get("robot_library/ur5_robot/robot_description_semantic.srdf")
semantics = RobotSemantics.from_srdf_file(srdf_filename, robot_model)
robot = Robot(robot_model, semantics=semantics)

What type of change is this?

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

yck011522 commented 4 months ago

@gonzalocasas (whenever you are free, not urgent). I cannot seem to get pass two integration doctests that connects to ROS in the Docker. They both threw the "Cannot Connect to ROS" error.

I see that there are only two files with docs that connects to ROS for testing.

Somehow there was no problem connecting to ROS from the client.py file.

I have tried to change the doc example to use a context manager (with RosClient() as ros:) but it doesn't help. I have tried adding timeout=30 to the connection but it doesn't help. I cannot reproduce the error in my local environment with python 3.8 (Windows), so maybe it is a Ubuntu thing?

yck011522 commented 4 months ago

@gonzalocasas (whenever you are free, not urgent). I cannot seem to get pass two integration doctests that connects to ROS in the Docker. They both threw the "Cannot Connect to ROS" error.

I see that there are only two files with docs that connects to ROS for testing.

  • src\compas_fab\backends\ros\client.py
  • src\compas_fab\robots\robot.py

Somehow there was no problem connecting to ROS from the client.py file.

I have tried to change the doc example to use a context manager (with RosClient() as ros:) but it doesn't help. I have tried adding timeout=30 to the connection but it doesn't help. I cannot reproduce the error in my local environment with python 3.8 (Windows), so maybe it is a Ubuntu thing?

Phew, Finally!! I just tried to change the Integration Test to run on py3.11 instead of 3.8 and the connection problem goes away. Also tried 3.10 and it does not work. Can you see if you are okay with py3.11 for Integration. @gonzalocasas

Edit: Okay, it is driving me crazy because it appears that the Ci just went through by sheer luck. The commit test in https://github.com/compas-dev/compas_fab/pull/407/commits/0e25492faf6ff996ab32cbcfc7f76f19dc05d288 was failing for no reason. Damn. I officially declare that I'm going crazy and we should merge now because the test just happened to go Green at the current commit.

yck011522 commented 3 months ago

@gonzalocasas How do you feel about the rather frequent testdocs failing. Or if you have any insight why it is failing.

jf--- commented 2 months ago

Amazing work @yck011522 !