Set robot sensor condition.
This command makes the robot load new termination condition for the bottom light sensors.
When the condition is satisfied while the robot moves, the robot will stop moving immediatelly without completing the requested movement.
If the robot is requested to move while the condition is still satisfied, the robot will remain still.
To clear the condition, use values 0, 0, 0. The sensors give a 6-bit value (s=0-63). The condition is satisfied, when
(((s ^ xorbits) & andbits) == andbits) || (((s ^ xorbits) & orbits) > 0). Use the function robot_satisfied to test if the condition
was satisfied.
- Source:
- robotdll/robotdll.h:578
- Author:
- Version:
- latest version
- Params:
| id
| robot object handle
|
| xorbits
| XOR-part of condition, 0-63, specifies which bits to invert before testing with andbits and orbits
|
| orbits
| OR-part of condition, 0-63, specifies a set of bits where at least one of them should be on (unless and-part is satisfied)
|
| andbits
| AND-part of condition, 0-63, specifies which bits have to be set (unless or-part is satisfied)
|
- See Also:
- robot_satisfied, robot_getsensors
- Code:
public ROBOTDLL_API void robot_condition ( | short id , |
| | short xorbits , |
| | short orbits , |
| | short andbits ) |