Skip to content

Commit

Permalink
Added Small comments and additions to the python_interface. Furthermo…
Browse files Browse the repository at this point in the history
…re added Debug warning for the topic switch
  • Loading branch information
JustMiep committed Mar 15, 2024
1 parent 1666dac commit 391831f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/giskardpy/monitors/force_torque_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self,
):

if is_raw:
logging.logwarn("ForceTorque Monitor is now listening to the /hsrb/wrist_wrench/raw Topic!")
topic = "/hsrb/wrist_wrench/raw"

super().__init__(name=name, stay_true=False, start_condition=start_condition, run_call_in_thread=False)
Expand Down Expand Up @@ -68,6 +69,7 @@ def force_T_map_transform(self, picker):

return torque_transformed

# TODO: Add proper checks for all necessary Items!
def __call__(self):

rob_force = self.force_T_map_transform(1)
Expand Down
6 changes: 4 additions & 2 deletions src/giskardpy/python_interface/python_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,8 @@ def monitor_placing(self,
force_torque_trigger = self.monitors.add_monitor(monitor_class=PayloadForceTorque.__name__,
name=PayloadForceTorque.__name__,
start_condition='',
threshold_name=ForceTorqueThresholds.FT_Placing.value)
threshold_name=ForceTorqueThresholds.FT_Placing.value,
is_raw=False)

self.motion_goals.add_motion_goal(motion_goal_class='Placing',
context=context,
Expand Down Expand Up @@ -1579,7 +1580,8 @@ def monitor_grasp_carefully(self,
force_torque_trigger = self.monitors.add_monitor(monitor_class=PayloadForceTorque.__name__,
name=PayloadForceTorque.__name__,
start_condition='',
threshold_name=ForceTorqueThresholds.FT_GraspWithCare.value)
threshold_name=ForceTorqueThresholds.FT_GraspWithCare.value,
is_raw=False)

self.motion_goals.add_motion_goal(motion_goal_class='GraspCarefully',
goal_pose=goal_pose,
Expand Down
8 changes: 3 additions & 5 deletions src/giskardpy/suturo_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ class GripperTypes(Enum):
# TODO: Create Enums for every Force and/or Torque sensitive action, to be used in force_torque_monitor.py
@unique
class ForceTorqueThresholds(Enum):
FT_GraspWithCare = 'FTGraspC' # For any "Conventional Object" (for other objects use extra enum?)
FT_GraspWithCare = 'FTGraspC' # For any "Conventional Object" (for other objects use extra enum?)
FT_Placing = 'FTPlace'
FT_Door = 'FTDoor'
FT_DishDoor = 'FTDishDoor'
FT_GraspCutlery = 'FTGraspCutlery'
#FT_Tilt = 'FTTilt' #Pouring
#FT_Shelf_Grasp = 'FT_Shelf'


FT_Tilt = 'FTTilt' # Pouring
# FT_Shelf_Grasp = 'FT_Shelf'
6 changes: 4 additions & 2 deletions test/test_integration_hsr.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def test_force_monitor_grasp(self, zero_pose: HSRTestWrapper):
force_torque = zero_pose.monitors.add_monitor(monitor_class=PayloadForceTorque.__name__,
name=PayloadForceTorque.__name__,
start_condition='',
threshold_name=ForceTorqueThresholds.FT_GraspWithCare.value)
threshold_name=ForceTorqueThresholds.FT_GraspWithCare.value,
is_raw=False)

base_goal = PoseStamped()
base_goal.header.frame_id = 'map'
Expand Down Expand Up @@ -155,7 +156,8 @@ def test_force_monitor_placing(self, zero_pose: HSRTestWrapper):
force_torque = zero_pose.monitors.add_monitor(monitor_class=PayloadForceTorque.__name__,
name=PayloadForceTorque.__name__,
start_condition='',
threshold_name=ForceTorqueThresholds.FT_Placing.value)
threshold_name=ForceTorqueThresholds.FT_Placing.value,
is_raw=False)

base_goal = PoseStamped()
base_goal.header.frame_id = 'map'
Expand Down

0 comments on commit 391831f

Please sign in to comment.