Skip to content

Commit

Permalink
location of pickup works
Browse files Browse the repository at this point in the history
  • Loading branch information
waymao committed Jul 7, 2023
1 parent d82f35c commit e4cda37
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions scripts/obtain_pick_item_pose.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
##################################################################

import rospy
from geometry_msgs.msg import TransformStamped, PoseStamped
from geometry_msgs.msg import TransformStamped, PoseStamped, Quaternion
from gazebo_msgs.msg import ModelStates
from tf.transformations import quaternion_from_euler
import tf2_ros
import tf2_geometry_msgs

Expand Down Expand Up @@ -56,7 +57,9 @@ def get_pose(self):
while True:
try:
target_transform: TransformStamped = self.tf_buffer.lookup_transform(LOCOBOT_TF, WORLD_TF, rospy.Time(0))
return tf2_geometry_msgs.do_transform_pose(self.object_pose, target_transform)
target_pose = tf2_geometry_msgs.do_transform_pose(self.object_pose, target_transform).pose
target_pose.orientation = Quaternion(*quaternion_from_euler(ai=0, aj=0.8, ak=0))
return target_pose
except (tf2_ros.LookupException, tf2_ros.ConnectivityException, tf2_ros.ExtrapolationException) as e:
rate.sleep()

Expand Down
8 changes: 4 additions & 4 deletions scripts/universal_move_arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ def main():

# go to some valid pose
# arm_group.go_to_pose_goal()
arm_group.go_to_pose_goal(Pose(
position=Point(x=0.5, y=0, z=0.35),
orientation=Quaternion(x=0, y=0, z=0, w=1)
))
# arm_group.go_to_pose_goal(Pose(
# position=Point(x=0.5, y=0, z=0.35),
# orientation=Quaternion(x=0, y=0, z=0, w=1)
# ))

# go to the location of a specific object
pose_calc = PickUpPoseCalculator("cricket_ball")
Expand Down

0 comments on commit e4cda37

Please sign in to comment.