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
romanarust
left a comment
There was a problem hiding this comment.
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.
| 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.
| 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.
| kwargs['cone_sides'] = visibility_constraint.cone_sides if visibility_constraint.cone_sides >= 3 else 3 | |
| kwargs['cone_sides'] = visibility_constraint.cone_sides |
| 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.
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.
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.
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.
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.
delete this line and make them as attributes of the VisibilityConstraint
| """ | ||
| def __init__(self): | ||
| raise NotImplementedError | ||
|
|
There was a problem hiding this comment.
| 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.
probably needs to be defined and checked.
see possible_types of BoundingVolume check
Visibility constraint for MoveIt backend:
compas_fab.robots.constraints.VisibilityConstraintcompas_fab.backends.ros.messages.VisibilityConstraintI 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.rstfile in theUnreleasedsection under the most fitting heading (e.g.Added,Changed,Removed).invoke test).invoke lint) .compas_fab.robots.Configuration.