Skip to content

fix: Migrate from cameraname to sensorSelectionInfo #26

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
17 changes: 10 additions & 7 deletions python/mujinplanningclient/binpickingplanningclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def PickAndPlace(
worksteplength=None,
densowavearmgroup=5,
regionname=None,
cameranames=None,
sensorSelectionInfos=None,
envclearance=None,
toolname=None,
robotspeed=None,
Expand All @@ -92,7 +92,7 @@ def PickAndPlace(
worksteplength (float, optional): planning parameter
densowavearmgroup (int, optional): planning parameter (Default: 5)
regionname (str, optional): name of the region of the objects
cameranames (list[str], optional): The names of the cameras to avoid occlusions with the robot
sensorSelectionInfos (list[dict[str, str]], optional): The sensorSelectionInfo configs of the cameras to avoid occlusions with the robot.
envclearance (float, optional): Environment clearance in millimeters.
toolname (str, optional): Name of the manipulator. Defaults to currently selected tool
robotspeed (float, optional): Value in (0,1] defining the percentage of speed the robot should move at.
Expand Down Expand Up @@ -165,7 +165,7 @@ def StartPickAndPlaceThread(
robotspeed (float, optional): Value in (0,1] defining the percentage of speed the robot should move at.
timeout (float, optional): Time in seconds after which the command is assumed to have failed. (Default: 10)
densowavearmgroup (int, optional): robot parameters (Default: 5)
cameranames (list[str], optional): the names of the cameras to avoid occlusions with the robot
sensorSelectionInfos (list[dict[str, str]], optional): The sensorSelectionInfo configs of the cameras to avoid occlusions with the robot.
cycledests (int, optional): When finished cycling through all destikparamnames, will delete all the targets and start from the first index again doing this for cycledests times. By default it is 1.
desttargetname (str, optional): The destination target name where the destination goal ikparams come from
destikparamnames (list[list[str]], optional): A list of lists of ikparam names for the ordered destinations of the target. destikparamnames[0] is where the first picked up part goes, desttargetname[1] is where the second picked up target goes.
Expand Down Expand Up @@ -348,12 +348,15 @@ def MoveToDropOff(self, dropOffInfo, robotname=None, robotspeed=None, robotaccel
taskparameters.update(kwargs)
return self.ExecuteCommand(taskparameters, robotname=robotname, robotspeed=robotspeed, robotaccelmult=robotaccelmult, timeout=timeout)

def IsRobotOccludingBody(self, bodyname, cameraname, timeout=10, **kwargs):
def IsRobotOccludingBody(self, bodyname, sensorSelectionInfo, timeout=10, **kwargs):
"""returns if the robot is occluding body in the view of the specified camera

Args:
bodyname: Name of the object
cameraname: Name of the camera
sensorSelectionInfo (dict[str, str]): A dictionary with the structure:

- sensorName (str): Name of the sensor body
- sensorLinkName (str): Name of the sensor link
timeout (float, optional): Time in seconds after which the command is assumed to have failed. (Default: 10)

Returns:
Expand All @@ -364,7 +367,7 @@ def IsRobotOccludingBody(self, bodyname, cameraname, timeout=10, **kwargs):
taskparameters = {
'command': 'IsRobotOccludingBody',
'bodyname': bodyname,
'cameraname': cameraname,
'sensorSelectionInfo': sensorSelectionInfo,
}
taskparameters.update(kwargs)
return self.ExecuteCommand(taskparameters, timeout=timeout)
Expand Down Expand Up @@ -428,7 +431,7 @@ def MoveRobotOutOfCameraOcclusion(self, regionname=None, robotspeed=None, toolna
robotspeed (float, optional): Value in (0,1] defining the percentage of speed the robot should move at.
toolname (str, optional): Name of the manipulator. Defaults to currently selected tool
timeout (float, optional): Time in seconds after which the command is assumed to have failed. (Default: 10)
cameranames (list[str], optional): The names of the cameras to avoid occlusions with the robot
sensorSelectionInfos (list[dict[str, str]], optional): The sensorSelectionInfo configs of the cameras to avoid occlusions with the robot.
"""
if regionname is None:
regionname = self.regionname
Expand Down
2 changes: 1 addition & 1 deletion python/mujinplanningclient/realtimerobotplanningclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def UpdateObjects(
object_uri (str, optional): Same as objectname, but in a Mujin URI format, e.g.: mujin:/OBJECTNAME.mujin.dae
detectionResultState (dict, optional): Information about the detected objects (received from detectors)
targetUpdateNamePrefix (str, optional):
cameranames (list[str], optional):
sensorSelectionInfos (list[dict[str, str]], optional): The sensorSelectionInfo configs of the cameras to avoid occlusions with the robot.
countOverlappingPoints (bool, optional):
overlapUpAxis (list[float], optional): Values of ['x', 'y', 'z'] correspondingly.
zthresholdmult (float, optional):
Expand Down