PiImageStreamer
Loading...
Searching...
No Matches
NetworkCommands.h
Go to the documentation of this file.
1
28#ifndef NETWORKCOMMANDS_H_
29#define NETWORKCOMMANDS_H_
30
31#define BROADCAST_SHUTDOWN_COMMAND (0x0100FFFF) // Sent as a broadcast message; every component that receives it stops its thread.
32#define BROADCAST_EMERGENCY_STOP (0x01FFFFFF) // Sent as a broadcast message; components that move the robot should stop immediately.
33
37#define LIGHTPWMADJUSTMENTCMD (0x01000000)
38// Parameter 1: This is the PWM duty cycle. Valid range is 0 to 1000, with 1000 representing 100% duty cycle.
39
43#define LIGHTONCMD (0x00100000)
44
48#define LIGHTOFFCMD (0x00010000)
49
50#define MOTOR_DIRECTION_CONTROL_CMD (0x02000011) // This indicates that a motor direction control command has been sent across the network to the given device. The robot should respond accordingly.
51 // Parameter 1: This parameter is the direction.
52 #define MOTOR_FORWARD 0x00000001 // This indicates the robot is commanded to drive forward.
53 #define MOTOR_BACKWARD 0x00000002 // This indicates the robot is commanded to drive backward.
54 #define MOTOR_LEFT 0x00000004 // This indicates the robot is commanded to steer to the left while moving.
55 #define MOTOR_RIGHT 0x00000008 // This indicates the robot is commanded to steer to the right while moving.
56 #define MOTOR_STOP 0x00000010 // This indicates that the robot is commanded to stop.
57
58#define MOTOR_SPEED_CONTROL_CMD (0x02000021) // This command indicates that the rest of the word being sent over the network is consumed by the speed setting.
59 // Parameter 1: Motor speed in pwm, with a value between 0 and 1000 representing 0 to 100 percent duty cycle.
60
61#define MOTOR_SPEED_ACTIVATE_CAUTION_CMD (0x02000022) // This command will activate caution mode. In essence, when this mode is active, the speed (aka PWM) of the vehicle will be reduced by 50% so long as the caution mode is active.
62#define MOTOR_SPEED_CLEAR_CAUTION_CMD (0x02000024) // This command will clear the respective caution mode, causing the robot to return to full speed operation.
63
64#define MOTOR_STEERING_OFFSET_CONTROL_CMD (0x02000031) // This command indicates that the steering is to be adjusted accordingly.
65 // Parameter 1: The steering parameter, which is a value between 0 and 200, with 100 representing straight forward / no adjustments to the steering. Note that the network parameter is of the range 0 to 200, which may not match the needs of the called method.
66
67#define HORN_MUTE_COMMAND (0x02000041) // This command will mute the horn.
68#define HORN_SOUND_COMMAND (0x02000042) // This command indicates that the horn is to sound continuously.
69#define HORN_PULSE_COMMAND (0x02000043) // This indicates that the command received is a command to pulse the horn.
70 // Parameter 1: Period in ms. This is the period of the pulsed horn, given in ms.
71 // Parameter 2: This is the on time for the pulsed horn, given in ms.
72
73#define START_LINE_SENSING_CMD (0x02000051) // This command will cause the robot to start line sensing. When line sensing, the robot will read the line values, stopping if all sensors are black. Line sensing must be enabled to have line following performed.
74#define STOP_LINE_SENSING_CMD (0x02000052) // This command will stop line sensing. When doing this, it will also effectively stop line following as well.
75#define ENABLE_LINE_FOLLOWING_CMD (0x02000055) // This command will start line following. For the command to be processed, line sensing must be enabled.
76#define DISABLE_LINE_FOLLOWING_CMD (0x02000056) // This command will stop line following.
77
78#define UPDATE_LIGHT_COLOR_CMD (0x02000061) // This command will set the color of the searchlight.
79 // Parameter 1: The least significant 24 bits will be the RGB code for the color. The encoding will be 00RRGGBB, with each byte representing a red, green, or blue color component.
80#define CAMERA_CHANGE_ELEVATION_CMD (0x02000071) // This command will set the elevation for the camera.
81 // Parameter 1: This parameter is the elevation for the camera. The parameter ranges between 0 and 180, with 90 being the camera being perfectly level, 180 indicating the camera is pointing straight up to the sky, and 0 being the camera pointing straight down. Physical hardware may limit this range of motion.
82#define CAMERA_CHANGE_AZIMUTH_CMD (0x02000072) // This command will set the azimuth for the camera.
83 // Parameter 1: This is the parameter for the azimuth. The parameter ranges between 0 and 180, with 90 being straight ahead.
84
85#define ENABLE_STOP_SENSING_CMD (0x02000081) // This command will enable sensing of stop signs which will cause the robot to stop.
86#define DISABLE_STOP_SENSING_CMD (0x02000082) // This command will disable sensing of stop signs, so the robot will no longer stop for them.
87#define ENABLE_FULL_SIGN_SENSING_CMD (0x02000085) // This command will enable sensing of all signs from the camera.
88#define DISABLE_FULL_SIGN_SENSING_CMD (0x02000086) // This command will disable sensing of all signs but stop signs from the camera.
89
90#define HEARTBEAT_REQUEST_MSG (0x04000020) // A heartbeat request sent to the heartbeat controller over the network.
91#define HEARTBEAT_COMPONENT_PING_REQUEST (0x0400A55A) // Sent by the heartbeat controller to each component to check that it is responding.
92#define HEARTBEAT_COMPONENT_RESPONSE_MSG (0x04005AA5) // A component's response to a ping request, enqueued on the heartbeat queue.
93 // Parameter 1: The internal queue ID of the responding component.
94
98#define REPORT_NEW_IPADDRESS (0x08000011) // This reports that a network client has connected.
99 // Parameter 1: This is the 32 bit ip address of the connected client, in host byte order.
100#define REPORT_IP_CONNECTION_DISCONNECTED (0x08000012) // This reports that the network client has disconnected.
101 // Parameter 1: Always 0.
102#define REPORT_DIRECTION_STATUS (0x08000021) // This reports the current direction of motion of the robot.
103 // Parameter 1: This will be a bitmap of the MOTOR_DIRECTION_CONTROL_CMD parameters (MOTOR_LEFT, MOTOR_RIGHT, etc.)
104#define DISTANCE_MEASUREMENT_REPORT (0x08000041) // This command here is related to reporting back of distance measurements.
105 // Parameter 1: What type of distance is being reported back
106 #define DISTANCE_MEASUREMENT_REPORT_CURRENTREADINGBITMAP (0x08000000) // This indicates the current reading is being returned.
107 #define DISTANCE_MEASUREMENT_REPORT_AVEREADINGBITMAP (0x04000000) // This indicates the average reading is being returned.
108 #define DISTANCE_MEASUREMENT_REPORT_MAXREADINGBITMAP (0x02000000) // This indicates the max reading is being returned.
109 #define DISTANCE_MEASUREMENT_REPORT_MINREADINGBITMAP (0x01000000) // This indicates the minimum reading is being returned.
110
111#endif /* NETWORKCOMMANDS_H_ */