-
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
Visibility constraint #151
base: main
Are you sure you want to change the base?
Conversation
SENSOR_X, SENSOR_Y, SENSOR_Z in the VisibilityConstraint moveit messsage definition are just constants, not arguments to pass
…ler/compas_fab into VisibilityConstraint
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.
Hi Matteo! Great! I am curious to see how and if this constraint works. As discussed, would be cool if you can add an example (in the docs).
sensor_view_direction=2, weight=1.): | ||
self.target_radius = float(target_radius) | ||
self.target_pose = target_pose | ||
self.cone_sides = cone_sides if cone_sides >= 3 else 3 |
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.
self.cone_sides = cone_sides if cone_sides >= 3 else 3 | |
self.cone_sides = max(cone_sides, 3) |
def __init__(self): | ||
raise NotImplementedError | ||
|
||
def __init__(self, target_radius=None, target_pose=None, cone_sides=None, |
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.
def __init__(self, target_radius=None, target_pose=None, cone_sides=None, | |
def __init__(self, target_radius=None, target_pose=None, cone_sides=3, |
kwargs = {} | ||
kwargs['target_radius'] = visibility_constraint.target_radius | ||
kwargs['target_pose'] = target_pose_stamped | ||
kwargs['cone_sides'] = visibility_constraint.cone_sides if visibility_constraint.cone_sides >= 3 else 3 |
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.
kwargs['cone_sides'] = visibility_constraint.cone_sides if visibility_constraint.cone_sides >= 3 else 3 | |
kwargs['cone_sides'] = visibility_constraint.cone_sides |
@@ -130,6 +131,9 @@ def _convert_constraints_to_rosmsg(self, constraints, header): | |||
elif c.type == c.ORIENTATION: | |||
ros_constraints.orientation_constraints.append( | |||
OrientationConstraint.from_orientation_constraint(header, c)) | |||
elif c.type == c.VISIBILITY: | |||
ros_constraints.visibility_constraints.append( | |||
VisibilityConstraint.from_visibility_constraint(c, header.frame_id)) |
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.
See comment further below: the reference frame in this case should already be defined in c.
VisibilityConstraint.from_visibility_constraint(c, header.frame_id)) | |
VisibilityConstraint.from_visibility_constraint(c) |
|
||
Examples | ||
-------- | ||
TODO |
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.
Would be good to add an example, or maybe even better: an example for our docs with a nice graphic on how the visibility constraint works :)
just not with any other links. | ||
|
||
Detailed explanations of visibility constraint: | ||
http://docs.ros.org/kinetic/api/moveit_core/html/classkinematic__constraints_1_1VisibilityConstraint.html |
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.
not sure if this is appropriate here, as this refers to moveit's docs
|
||
Attributes | ||
---------- | ||
target_frame: :class:`compas.geometry.Frame` |
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.
As discussed just before in a meeting, to reduce the number of parameters to pass to the constraint, maybe it would be good add another class: A frame relative to a robots link (like the PoseStamped
in ROS). Then you don't have to pass target_frame
+target_frame_reference_link
and sensor_frame
+sensor_frame_reference_link
individually, but only target_reference_frame
and sensor_reference_frame
. (if nameing of ReferenceFrame
would be approved ;))
|
||
def __init__(self, target_radius=None, target_pose=None, cone_sides=None, | ||
sensor_pose=None, max_view_angle=0.0, max_range_angle=0.0, | ||
SENSOR_X=None, SENSOR_Y=None, SENSOR_Z=None, |
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.
delete this line and make them as attributes of the VisibilityConstraint
@@ -276,13 +279,57 @@ def from_joint_constraint(cls, joint_constraint): | |||
class VisibilityConstraint(ROSmsg): | |||
"""http://docs.ros.org/kinetic/api/moveit_msgs/html/msg/VisibilityConstraint.html | |||
""" | |||
def __init__(self): | |||
raise NotImplementedError | |||
|
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.
SENSOR_Z = 0 | |
SENSOR_Y = 1 | |
SENSOR_X = 2 | |
sensor origin to the target frame origin. The value is again in the range (0, Pi/2) | ||
and is NOT enforced if set to 0. | ||
Defaults to 0.0 | ||
sensor_view_direction: int, optional |
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.
probably needs to be defined and checked.
see possible_types of BoundingVolume
check
Visibility constraint for MoveIt backend:
compas_fab.robots.constraints.VisibilityConstraint
compas_fab.backends.ros.messages.VisibilityConstraint
I am testing it as a way of getting IK solutions that don't obstruct iGPS visibility.
Initial tests seem promising :)
What type of change is this?
Checklist
CHANGELOG.rst
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
) .compas_fab.robots.Configuration
.