Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Changed the behavior of Duration class when accepting both seconds (float) and nanoseconds (int) where the decimal point of seconds and the nanoseconds add up to more than 1 second.
* Changed GH Component `ConstraintsFromPlane` to `FrameTargetFromPlane`.
* Changed GH Component `ConstraintsFromTargetConfiguration` to `ConfigurationTarget`.
* Changed `RosClient` constructor to take a type for planner backend instead of a string. This also changes the name of the argument from `planner_backend` to `planner_type`.

### Removed

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
numpy >= 1.15.4, < 2
Copy link
Member Author

@gonzalocasas gonzalocasas Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is temporary until this compas-dev/compas#1372 is merged and released

compas >= 2.0.4, < 3
compas_robots >= 0.3, < 1
roslibpy >= 1.1.0
Expand Down
16 changes: 6 additions & 10 deletions src/compas_fab/backends/ros/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
"RosClient",
]

PLANNER_BACKENDS = {"moveit": MoveItPlanner}


class CancellableRosActionResult(CancellableFutureResult):
def __init__(self, goal):
Expand Down Expand Up @@ -116,10 +114,10 @@ class RosClient(Ros, ClientInterface):
Port of the ROS Bridge. Defaults to ``9090``.
is_secure : :obj:`bool`
``True`` to indicate it should use a secure web socket, otherwise ``False``.
planner_backend: str
Name of the planner backend plugin to use. The plugin must be a sub-class of
:class:`compas_fab.backends.PlannerInterface`. Defaults to ``"moveit"``,
making use of :class:`compas_fab.backends.MoveItPlanner`.
planner_type: type
Type the planner backend to use. The backend must be a sub-class of
:class:`compas_fab.backends.PlannerInterface`.
Defaults to :class:`~compas_fab.backends.MoveItPlanner`.

Examples
--------
Expand All @@ -132,11 +130,9 @@ class RosClient(Ros, ClientInterface):
For more examples, check out the :ref:`ROS examples page <ros_examples>`.
"""

def __init__(self, host="localhost", port=9090, is_secure=False, planner_backend="moveit"):
def __init__(self, host="localhost", port=9090, is_secure=False, planner_type=MoveItPlanner):
super(RosClient, self).__init__(host, port, is_secure)

planner_backend_type = PLANNER_BACKENDS[planner_backend]
self.planner = planner_backend_type(self)
self.planner = planner_type(self)
self._ros_distro = None

def __enter__(self):
Expand Down