Shop OBEX P1 Docs P2 Docs Learn Events
How to increase S2 robot's movement buffer — Parallax Forums

How to increase S2 robot's movement buffer

william chanwilliam chan Posts: 1,326
edited 2011-03-30 15:42 in Robotics
I noticed that I can only call about 3 s2.go_forward(Dist) commands before the function blocks and does not return until the first movement is completed.
I need the call to be returned quickly so that the supervisor cog can perform other functions.
Is there a buffer somewhere where I can increase its size so that I can call more move commands consecutively without it blocking? (not returning quickly)

Thanks.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-03-30 10:20
    William,

    Only one command can be buffered while another is executing, and this is done only to provide smooth continuity between drawing commands in a path. Rather than trying to modify the buffering, it would be much easier to use the move_ready method to see if a new command can be issued without blocking.

    -Phil
  • william chanwilliam chan Posts: 1,326
    edited 2011-03-30 15:42
    Thanks a million.
Sign In or Register to comment.