-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robot library remove old robots #407
Conversation
@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 ( |
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 0e25492 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. |
@gonzalocasas How do you feel about the rather frequent |
…s it is terminated immediately
This reverts commit 30b6fe6.
…mplementation of roslibpy Run and Close.
def run(self, timeout=2.0): | ||
"""Kick-starts a non-blocking event loop. | ||
|
||
Args: | ||
timeout: Timeout to wait until connection is ready. | ||
""" | ||
import threading | ||
import time | ||
from roslibpy.core import RosTimeoutError | ||
|
||
t1 = time.time() | ||
wait_connect = threading.Event() | ||
self.factory.on_ready(lambda _: wait_connect.set()) | ||
|
||
self.factory.manager.run() | ||
if not wait_connect.wait(timeout): | ||
t2 = time.time() | ||
raise RosTimeoutError("Failed to connect to ROS. Start Time: {}, Time elapsed: {}".format(t1, t2 - t1)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete this one! ;)
|
||
|
||
@pytest.fixture(scope="function", autouse=True) | ||
def connect_to_ros(request, doctest_namespace): | ||
if request.module.__name__ == "compas_fab.robots.robot": | ||
doctest_namespace["robot"] = Robot() | ||
yield | ||
elif request.module.__name__ == "compas_fab.robots.planning_scene": | ||
with RosClient() as client: | ||
robot = Robot(client) | ||
|
||
doctest_namespace["client"] = client | ||
doctest_namespace["robot"] = robot | ||
|
||
yield | ||
else: | ||
yield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay! Out with the trash!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 LGTM!
Amazing work @yck011522 ! |
This depends on #406, we should review and merge #406 first before this one.
Removed
compas_fab.robots.ur5
because it is now part ofcompas_fab.robots.RobotLibrary
.Removed data files of ur5 and ur10e from
src/compas_fab/data/universal_robots
because they are now in ofsrc/compas_fab/data/robot_library
.Future constructs should use:
Or from URDF and SRDF from scratch
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.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas_fab.robots.CollisionMesh
.