Exemplo n.º 1
0
    def move_arm(self, positions):    
        self._arm_goal = copy.deepcopy(positions)
        jp = YoubotProxy.make_brics_msg_arm(self.arm_num, positions)
        rospy.logdebug("brics message created")
        rospy.logdebug(jp)
        r = rospy.Rate(50)
        t0 = rospy.Time().now()
        pubbed = False
        while not rospy.is_shutdown():
            curr_jpos = self._joint_positions_arm
            d = BaseProxy.measure_joint_distance_sum(curr_jpos, positions)
            v = BaseProxy.measure_joint_velocity_ss(self._joint_velocities_arm)
            rospy.logdebug(d)
            rospy.logdebug("arm joint positions")
            rospy.logdebug(curr_jpos)
            rospy.logdebug(d)
            rospy.logdebug("arm joint velocities")
            rospy.logdebug(self._joint_velocities_arm)            
            if ((d < self.arm_joint_distance_tol) and (v<=self.arm_joint_velocity_tol)):
                # rospy.logdebug("moved arm to joint position error of: " + str(d))
                break        
            td = rospy.Time().now()
            if (td-t0 > self.arm_move_duration):
                rospy.logerr("move arm timeout")
                raise Exception("move arm timeout")
                break        

            self._arm_pub.publish(jp)
#             if not pubbed:
#                 self._arm_pub.publish(jp)
#                 pubbed = True
                
            r.sleep()
Exemplo n.º 2
0
    def move_arm(self, positions):
        self._arm_goal = copy.deepcopy(positions)
        jp = YoubotProxy.make_brics_msg_arm(self.arm_num, positions)
        rospy.logdebug("brics message created")
        rospy.logdebug(jp)
        r = rospy.Rate(50)
        t0 = rospy.Time().now()
        pubbed = False
        while not rospy.is_shutdown():
            curr_jpos = self._joint_positions_arm
            d = BaseProxy.measure_joint_distance_sum(curr_jpos, positions)
            v = BaseProxy.measure_joint_velocity_ss(self._joint_velocities_arm)
            rospy.logdebug(d)
            rospy.logdebug("arm joint positions")
            rospy.logdebug(curr_jpos)
            rospy.logdebug(d)
            rospy.logdebug("arm joint velocities")
            rospy.logdebug(self._joint_velocities_arm)
            if ((d < self.arm_joint_distance_tol)
                    and (v <= self.arm_joint_velocity_tol)):
                # rospy.logdebug("moved arm to joint position error of: " + str(d))
                break
            td = rospy.Time().now()
            if (td - t0 > self.arm_move_duration):
                rospy.logerr("move arm timeout")
                raise Exception("move arm timeout")
                break

            self._arm_pub.publish(jp)
            #             if not pubbed:
            #                 self._arm_pub.publish(jp)
            #                 pubbed = True

            r.sleep()
Exemplo n.º 3
0
    def __init__(self):
        BaseProxy.__init__(self)

        self.html_comment_re = re.compile(r"<!--.*?-->", re.S)
        self.html_script_re = re.compile(r"<script.*?</script>", re.S)

        # note: we use re.match which requires match from beginning
        self.public_paths_re = re.compile(
            r"/(s/|images/|favicon\.ico|rest/api/1\.0/(header-separator|dropdowns)($|\?))"
        )
Exemplo n.º 4
0
    def _collect_request_parameters(self, **kwargs):
        BaseProxy._collect_request_parameters(self, **kwargs)

        # jira puts hostname into self-referential links, and hostname comes from jira configuration.
        # in case of jira proxy-served pages, that hostname is wrong.
        # this means an http accelerator like varnish which does not edit response bodies
        # cannot serve usable pages when running on any host other than configured jira host.
        # in turn this means jira proxy must always be involved in proxying process.
        # running an accelerator on top of jira-proxy makes latency even worse, so to maintain
        # some semblance of sanity we have to do all transformations that varnish does.
        self._adjust_request()
Exemplo n.º 5
0
    def perform(self, **kwargs):
        BaseProxy.perform(self, **kwargs)

        self._adjust_cache_directives()
        self._adjust_host_in_links()
Exemplo n.º 6
0
    def _issue_remote_request(self):
        BaseProxy._issue_remote_request(self)

        # see note in _collect_request_parameters.
        # do what should be done in varnish
        self._adjust_response()