當前位置: 首頁>>代碼示例>>Python>>正文


Python JointValue.timeStamp方法代碼示例

本文整理匯總了Python中brics_actuator.msg.JointValue.timeStamp方法的典型用法代碼示例。如果您正苦於以下問題:Python JointValue.timeStamp方法的具體用法?Python JointValue.timeStamp怎麽用?Python JointValue.timeStamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在brics_actuator.msg.JointValue的用法示例。


在下文中一共展示了JointValue.timeStamp方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: update_gripper_position

# 需要導入模塊: from brics_actuator.msg import JointValue [as 別名]
# 或者: from brics_actuator.msg.JointValue import timeStamp [as 別名]
 def update_gripper_position(self, data):
     u"""Открывает/закрывает гриппер."""
     self.gripper_position.positions = []
     # Open gripper
     if data.buttons[6]:
         tmp_gripper_position_r = JointValue()
         tmp_gripper_position_r.joint_uri = 'gripper_finger_joint_r'
         tmp_gripper_position_r.value = 0.011499
         tmp_gripper_position_r.unit = 'm'
         tmp_gripper_position_r.timeStamp = rospy.Time.now()
         self.gripper_position.positions.append(tmp_gripper_position_r)
         tmp_gripper_position_l = JointValue()
         tmp_gripper_position_l.joint_uri = 'gripper_finger_joint_l'
         tmp_gripper_position_l.value = 0.011499
         tmp_gripper_position_l.unit = 'm'
         tmp_gripper_position_l.timeStamp = rospy.Time.now()
         self.gripper_position.positions.append(tmp_gripper_position_l)
     # Close gripper
     if data.buttons[7]:
         tmp_gripper_position_r = JointValue()
         tmp_gripper_position_r.joint_uri = 'gripper_finger_joint_r'
         tmp_gripper_position_r.value = 0
         tmp_gripper_position_r.unit = 'm'
         tmp_gripper_position_r.timeStamp = rospy.Time.now()
         self.gripper_position.positions.append(tmp_gripper_position_r)
         tmp_gripper_position_l = JointValue()
         tmp_gripper_position_l.joint_uri = 'gripper_finger_joint_l'
         tmp_gripper_position_l.value = 0
         tmp_gripper_position_l.unit = 'm'
         tmp_gripper_position_l.timeStamp = rospy.Time.now()
         self.gripper_position.positions.append(tmp_gripper_position_l)
開發者ID:kirillmorozov,項目名稱:youbot_control,代碼行數:33,代碼來源:joypad_control.py

示例2: moveGripper

# 需要導入模塊: from brics_actuator.msg import JointValue [as 別名]
# 或者: from brics_actuator.msg.JointValue import timeStamp [as 別名]
 def moveGripper(self, gPublisher, floatVal):
     jp = JointPositions()
     myPoison = Poison()
     myPoison.originator = 'yb_grip'
     myPoison.description = 'whoknows'
     myPoison.qos = 0.0
     jp.poisonStamp = myPoison
     nowTime = rospy.Time.now()
     jvl = JointValue()
     jvl.timeStamp = nowTime
     jvl.joint_uri = 'gripper_finger_joint_l'
     jvl.unit = 'm'
     jvl.value = floatVal
     jp.positions.append(jvl)
     jvr = JointValue()
     jvr.timeStamp = nowTime
     jvr.joint_uri = 'gripper_finger_joint_r'
     jvr.unit = 'm'
     jvr.value = floatVal
     jp.positions.append(jvr)
     gPublisher.publish(jp)
開發者ID:Abulala,項目名稱:kuka_youbot,代碼行數:23,代碼來源:youbot_gripper_server.py

示例3: set_gripper_state

# 需要導入模塊: from brics_actuator.msg import JointValue [as 別名]
# 或者: from brics_actuator.msg.JointValue import timeStamp [as 別名]
    def set_gripper_state(self, open_gripper=True):
        """Open/close gripper.

        Arguments:
            open_gripper (bool): if True - opens gripper, if False - otherwise
        """
        self.gripper_position.positions = []
        if open_gripper:
            # Open gripper
            tmp_gripper_position_r = JointValue()
            tmp_gripper_position_r.joint_uri = 'gripper_finger_joint_r'
            tmp_gripper_position_r.value = 0.011499
            tmp_gripper_position_r.unit = 'm'
            tmp_gripper_position_r.timeStamp = rospy.Time.now()
            self.gripper_position.positions.append(tmp_gripper_position_r)
            tmp_gripper_position_l = JointValue()
            tmp_gripper_position_l.joint_uri = 'gripper_finger_joint_l'
            tmp_gripper_position_l.value = 0.011499
            tmp_gripper_position_l.unit = 'm'
            tmp_gripper_position_l.timeStamp = rospy.Time.now()
            self.gripper_position.positions.append(tmp_gripper_position_l)
        else:
            # Close gripper
            tmp_gripper_position_r = JointValue()
            tmp_gripper_position_r.joint_uri = 'gripper_finger_joint_r'
            tmp_gripper_position_r.value = 0
            tmp_gripper_position_r.unit = 'm'
            tmp_gripper_position_r.timeStamp = rospy.Time.now()
            self.gripper_position.positions.append(tmp_gripper_position_r)
            tmp_gripper_position_l = JointValue()
            tmp_gripper_position_l.joint_uri = 'gripper_finger_joint_l'
            tmp_gripper_position_l.value = 0
            tmp_gripper_position_l.unit = 'm'
            tmp_gripper_position_l.timeStamp = rospy.Time.now()
            self.gripper_position.positions.append(tmp_gripper_position_l)
        self.gripper_position_publisher.publish(self.gripper_position)
開發者ID:kirillmorozov,項目名稱:youbot_control,代碼行數:38,代碼來源:rospyoubot.py

示例4: set_joints_velocities

# 需要導入模塊: from brics_actuator.msg import JointValue [as 別名]
# 或者: from brics_actuator.msg.JointValue import timeStamp [as 別名]
    def set_joints_velocities(self, *args):  # TODO: remove *args
        u"""Set velocity for each joint.

        Arguments:
            *args -- velocity for each joint (j1, j2, j3, j4, j5)

        Устанавливает скорость каждой степени подвижности в радианах/с.

        Аргументы:
            *args -- скорости соотвествующих степеней (j1, j2, j3, j4, j5)
        """
        assert len(args) == 5
        self.joints_velocities.velocities = []
        for index, value in enumerate(args):
            tmp = JointValue()
            tmp.timeStamp = rospy.Time.now()
            tmp.joint_uri = 'arm_joint_{}'.format(index + 1)
            tmp.unit = 's^-1 rad'
            tmp.value = value
            self.joints_velocities.velocities.append(tmp)
        self.joints_velocities_publisher.publish(self.joints_velocities)
開發者ID:kirillmorozov,項目名稱:youbot_control,代碼行數:23,代碼來源:rospyoubot.py

示例5: set_joints_angles

# 需要導入模塊: from brics_actuator.msg import JointValue [as 別名]
# 或者: from brics_actuator.msg.JointValue import timeStamp [as 別名]
    def set_joints_angles(self, *args):  # TODO: remove *args
        u"""Set arm joints to defined angles in radians.

        Arguments:
            *args -- joints angles (j1, j2, j3, j4, j5)

        Устанавливает углы поворота степеней подвижности в радианах.

        Аргументы:
            *args -- уголы соотвествующих степеней (j1, j2, j3, j4, j5)
        """
        assert len(args) <= 5
        self.joints_positions.positions = []
        for i in range(5):
            tmp = JointValue()
            tmp.timeStamp = rospy.Time.now()
            tmp.joint_uri = 'arm_joint_{}'.format(i + 1)
            tmp.unit = 'rad'
            tmp.value = args[i]
            self.joints_positions.positions.append(tmp)
        self.joints_positions_publisher.publish(self.joints_positions)
開發者ID:kirillmorozov,項目名稱:youbot_control,代碼行數:23,代碼來源:rospyoubot.py

示例6: initService

# 需要導入模塊: from brics_actuator.msg import JointValue [as 別名]
# 或者: from brics_actuator.msg.JointValue import timeStamp [as 別名]
from cob_srvs.srv import Trigger
from brics_actuator.msg import JointVelocities
from brics_actuator.msg import JointValue

rospy.init_node("ipa_canopen_test")

rospy.wait_for_service('/tray_controller/init')
print "found init"
initService = rospy.ServiceProxy('/tray_controller/init', Trigger)
resp = initService()

velPublisher = rospy.Publisher('/tray_controller/command_vel', JointVelocities)
rospy.sleep(2.0)
v = JointVelocities()
vv1 = JointValue()
vv1.timeStamp = rospy.Time.now()
vv1.joint_uri = "tray_1_joint"
vv2 = copy.deepcopy(vv1)
vv2.joint_uri = "tray_2_joint"
vv3 = copy.deepcopy(vv1)
vv3.joint_uri = "tray_3_joint"
v.velocities = [vv1,vv2,vv3]

v.velocities[0].value = 0.0

while not rospy.is_shutdown():
    v.velocities[0].value = 0.05
    v.velocities[1].value = 0.05
    velPublisher.publish(v)

    rospy.sleep(1.0)
開發者ID:ipa-fmw,項目名稱:ipa_canopen_tutorials,代碼行數:33,代碼來源:3dof_velcommander.py


注:本文中的brics_actuator.msg.JointValue.timeStamp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。