Gripper : add states and behavior of gripper#1
Conversation
ab795df to
ea19094
Compare
MatteoTschesche
left a comment
There was a problem hiding this comment.
Thanks for the work, I have some comments
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| """Demonstration state.""" |
| from gigatino_msgs.action import Calibrate | ||
| class CalibratetoOrigin(EventState): | ||
| """ | ||
| This state navigates the robot to the given pose using NavigateToPose messages |
There was a problem hiding this comment.
does not sound like calibrate
| -- action_topic Name of action to invoke | ||
|
|
||
| Outputs | ||
| <= home reached Robot reached pose successful. |
There was a problem hiding this comment.
does not sound like calibration
| """ | ||
| def __init__(self, timeout,action_topic='robotinobase2/gigatino/calibrate'): | ||
|
|
||
| super().__init__(outcomes=['pose_reached', 'failed', 'canceled', 'timeout'], |
There was a problem hiding this comment.
shouldn't the outcome be calibrated instead of pose_reached?
|
|
||
| if not self._client.has_result(self._topic): | ||
| self._client.cancel(self._topic) | ||
| Logger.loginfo('Cancelled active action goal.') No newline at end of file |
There was a problem hiding this comment.
No newline at end of file
| self._return = 'reached' | ||
| return self._return | ||
| if self._node.get_clock().now().nanoseconds - self._start_time.nanoseconds > self._target_time.nanoseconds: | ||
| # Normal completion, do not bother repeating the publish |
There was a problem hiding this comment.
wtf is this comment? xD
| User data | ||
| ># relative set default as false | ||
| ># target_frame Frame of the goal pose | ||
| ># x X value of goal pose |
There was a problem hiding this comment.
shouldn't this pose only use the z value?
| return self._return | ||
|
|
||
| if self._client.has_result(self._topic): | ||
| _ = self._client.get_result(self._topic) # The delta result value is not useful here |
There was a problem hiding this comment.
remove comments here
| self._return = 'reached' | ||
| return self._return | ||
| if self._node.get_clock().now().nanoseconds - self._start_time.nanoseconds > self._target_time.nanoseconds: | ||
| # Normal completion, do not bother repeating the publish |
| try: | ||
| self._client.send_goal(self._topic, goal, wait_duration=self._timeout_sec) | ||
| Logger.localinfo(f"{goal}") | ||
| except Exception as exc: # pylint: disable=W0703 |
There was a problem hiding this comment.
what thoes this comment mean? Also you can remove the others below
|
I think you can merge the GripperCloseState() and the GripperState() to one State. As an input you would give then something like command instead of open or close as key. So you can specify over the value which action should be called. So as far as I can see you then just execute the action with the key passed by user: |
add states and behavior of the gripper