radiochannel( channel )
Parameters
| Type | Description | |
| channel | numeric | channel number (1-9) |
_result
Not set.
Descriptions
Sets a robot's team radio tuner to listen to the channel specified by channel. Valid channel numbers are whole number from 1 to 9 inclusive.
Robots have two radio tuners for receiving messages. The two radio tuners are called the public radio tuner and the team radio tuner. The public tuner is always set to listen on channel 0 and can not be changed. Therefore robots receive all messages sent on channel 0. The team tuner listens on any single channel from 1 through 9 and is set by the radiochannel command. If the radiochannel command is never called, the team tuner defaults to listening on channel 1. The team tuner only receives messages that are sent on the channel to which it is assigned. For more information about the difference between the public channel 0 and the team channels 1-9, see the radiosend topic.
Incoming messages are placed in the _radiocomm system variable. When a robot receives radio messages it receives the sent message along with a bearing to the sending robot. It is important to realized that when a robot sends a message it is exposing information about its position. For more information about the format of received messages see the _radiocomm topic.
A robot can register an event handler to process incoming radio messages with the regradio command.
See Also