当前位置: 首页>>代码示例>>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;未经允许,请勿转载。