Skip to content

Using the /ir_opcode topic? #531

Closed Answered by slowrunner
slowrunner asked this question in Questions
Discussion options

You must be logged in to vote

Not easy, but I got it:

    def see_virtual_wall(self):
        see_it = False

        if (self.last_ir_opcode_msg.opcode == IrOpcode.CODE_IR_VIRTUAL_WALL):
          if ( ( self.get_clock().now() - Time.from_msg(self.last_ir_opcode_msg.header.stamp) ) < Duration(seconds=0.3)):
            see_it = True
          else:
            self.last_ir_opcode_msg.opcode = 0
        return see_it

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by slowrunner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant