wiki:ro

Version 5 (modified by jpawlick, 13 years ago) (diff)

--

This command turns the agent a number of degrees in the transverse plane (yaw) and a looks a number of degrees in the sagittal plane (pitch). See http://en.wikipedia.org/wiki/Anatomical_terms_of_location#Planes if you are confused about what that means.

Except in fc, directions are always specified relative to a bot's current facing. All walking movement, of course, ignores pitch, but swimming does not. There is a maximum pitch of 87 degrees, and a minimum pitch of -87 degrees.

A single ro typically carries an error of 0.000017%. If this is too large for your purposes, it may be wise to check your current facing before and after rotation, examine how much error the ro actually caused, and rotate that amount away in a second rotation. Typically, a fractional error of 0.00000017 squared is beyond floating point precision.

(The reason this is not implemented on the server side is that the server deliberately doesn't track what rotation you started at and ended at for a single command. Imagine that you begin an ro of 90 degrees to the left, then interrupt it with an ro of 90 degrees to the right. The interrupted ro will ideally record an offset of 0, not 90 degrees, and so if it were to track the "desired final orientation", it would continue and actually be a rotation of 180 degrees total. One might propose that when you place an ro on the command queue it updates all other waiting ros, but if you popped it or otherwise interrupted it, you would have to undo this work. In short, ro is not a "rotate-to" command.)

Parameters:

  • 1: float yaw, the number of degrees to turn to the left. The bot will always turn the shorter way. May be negative.
  • 2: float pitch, the number of degrees to look down from the current view. May be negative.

Reports:

  • done once turning is done. If you watch the bot, it will appear that the model rotates in successive jerks and finishes sooner than the command does. This is because the model rotation is not perfectly matched to the logical entity rotation.
  • popped if popped by po.
  • forgotten if deleted by fa or fm.
  • replaced if replaced by a command scheduled with 'r'.

Example:

  • User sends: "n ro 512 45 -30"
  • Bot turns left 45 degrees and looks 30 degrees up.
  • Bot replies "cp ro 512 done"