Browse Source

report yaw angle change

master
Alex Mikhalev 6 years ago
parent
commit
28bf68f4e6
  1. 31
      e32_client/messages_pb2.py
  2. 1
      main/messages.proto
  3. 1
      main/ugv_comms.cc
  4. 3
      main/ugv_comms.hh

31
e32_client/messages_pb2.py

@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( @@ -21,7 +21,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package='uas.ugv.messages',
syntax='proto3',
serialized_options=_b('H\003'),
serialized_pb=_b('\n\x0emessages.proto\x12\x10uas.ugv.messages\"V\n\x08Location\x12\x13\n\x0b\x66ix_quality\x18\x01 \x01(\r\x12\x10\n\x08latitude\x18\x02 \x01(\x02\x12\x11\n\tlongitude\x18\x03 \x01(\x02\x12\x10\n\x08\x61ltitude\x18\x04 \x01(\x02\"f\n\nUGV_Status\x12*\n\x05state\x18\x01 \x01(\x0e\x32\x1b.uas.ugv.messages.UGV_State\x12,\n\x08location\x18\x02 \x01(\x0b\x32\x1a.uas.ugv.messages.Location\"c\n\x0bUGV_Message\x12.\n\x06status\x18\x01 \x01(\x0b\x32\x1c.uas.ugv.messages.UGV_StatusH\x00\x12\x15\n\x0b\x63ommand_ack\x18\x02 \x01(\rH\x00\x42\r\n\x0bugv_message\"N\n\rGroundCommand\x12\n\n\x02id\x18\x01 \x01(\r\x12\x31\n\x04type\x18\x02 \x01(\x0e\x32#.uas.ugv.messages.GroundCommandType\"U\n\rGroundMessage\x12\x32\n\x07\x63ommand\x18\x01 \x01(\x0b\x32\x1f.uas.ugv.messages.GroundCommandH\x00\x42\x10\n\x0eground_message*f\n\tUGV_State\x12\x0e\n\nSTATE_IDLE\x10\x00\x12\x12\n\x0eSTATE_AQUIRING\x10\x01\x12\x11\n\rSTATE_DRIVING\x10\x02\x12\x12\n\x0eSTATE_FINISHED\x10\x03\x12\x0e\n\nSTATE_TEST\x10\x04*K\n\x11GroundCommandType\x12\x0f\n\x0b\x43MD_DISABLE\x10\x00\x12\x17\n\x13\x43MD_DRIVE_TO_TARGET\x10\x01\x12\x0c\n\x08\x43MD_TEST\x10\x02\x42\x02H\x03\x62\x06proto3')
serialized_pb=_b('\n\x0emessages.proto\x12\x10uas.ugv.messages\"V\n\x08Location\x12\x13\n\x0b\x66ix_quality\x18\x01 \x01(\r\x12\x10\n\x08latitude\x18\x02 \x01(\x02\x12\x11\n\tlongitude\x18\x03 \x01(\x02\x12\x10\n\x08\x61ltitude\x18\x04 \x01(\x02\"y\n\nUGV_Status\x12*\n\x05state\x18\x01 \x01(\x0e\x32\x1b.uas.ugv.messages.UGV_State\x12,\n\x08location\x18\x02 \x01(\x0b\x32\x1a.uas.ugv.messages.Location\x12\x11\n\tyaw_angle\x18\x03 \x01(\x02\"c\n\x0bUGV_Message\x12.\n\x06status\x18\x01 \x01(\x0b\x32\x1c.uas.ugv.messages.UGV_StatusH\x00\x12\x15\n\x0b\x63ommand_ack\x18\x02 \x01(\rH\x00\x42\r\n\x0bugv_message\"N\n\rGroundCommand\x12\n\n\x02id\x18\x01 \x01(\r\x12\x31\n\x04type\x18\x02 \x01(\x0e\x32#.uas.ugv.messages.GroundCommandType\"U\n\rGroundMessage\x12\x32\n\x07\x63ommand\x18\x01 \x01(\x0b\x32\x1f.uas.ugv.messages.GroundCommandH\x00\x42\x10\n\x0eground_message*f\n\tUGV_State\x12\x0e\n\nSTATE_IDLE\x10\x00\x12\x12\n\x0eSTATE_AQUIRING\x10\x01\x12\x11\n\rSTATE_DRIVING\x10\x02\x12\x12\n\x0eSTATE_FINISHED\x10\x03\x12\x0e\n\nSTATE_TEST\x10\x04*K\n\x11GroundCommandType\x12\x0f\n\x0b\x43MD_DISABLE\x10\x00\x12\x17\n\x13\x43MD_DRIVE_TO_TARGET\x10\x01\x12\x0c\n\x08\x43MD_TEST\x10\x02\x42\x02H\x03\x62\x06proto3')
)
_UGV_STATE = _descriptor.EnumDescriptor(
@ -53,8 +53,8 @@ _UGV_STATE = _descriptor.EnumDescriptor( @@ -53,8 +53,8 @@ _UGV_STATE = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
serialized_start=496,
serialized_end=598,
serialized_start=515,
serialized_end=617,
)
_sym_db.RegisterEnumDescriptor(_UGV_STATE)
@ -80,8 +80,8 @@ _GROUNDCOMMANDTYPE = _descriptor.EnumDescriptor( @@ -80,8 +80,8 @@ _GROUNDCOMMANDTYPE = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
serialized_start=600,
serialized_end=675,
serialized_start=619,
serialized_end=694,
)
_sym_db.RegisterEnumDescriptor(_GROUNDCOMMANDTYPE)
@ -170,6 +170,13 @@ _UGV_STATUS = _descriptor.Descriptor( @@ -170,6 +170,13 @@ _UGV_STATUS = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='yaw_angle', full_name='uas.ugv.messages.UGV_Status.yaw_angle', index=2,
number=3, type=2, cpp_type=6, label=1,
has_default_value=False, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
@ -183,7 +190,7 @@ _UGV_STATUS = _descriptor.Descriptor( @@ -183,7 +190,7 @@ _UGV_STATUS = _descriptor.Descriptor(
oneofs=[
],
serialized_start=124,
serialized_end=226,
serialized_end=245,
)
@ -223,8 +230,8 @@ _UGV_MESSAGE = _descriptor.Descriptor( @@ -223,8 +230,8 @@ _UGV_MESSAGE = _descriptor.Descriptor(
name='ugv_message', full_name='uas.ugv.messages.UGV_Message.ugv_message',
index=0, containing_type=None, fields=[]),
],
serialized_start=228,
serialized_end=327,
serialized_start=247,
serialized_end=346,
)
@ -261,8 +268,8 @@ _GROUNDCOMMAND = _descriptor.Descriptor( @@ -261,8 +268,8 @@ _GROUNDCOMMAND = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=329,
serialized_end=407,
serialized_start=348,
serialized_end=426,
)
@ -295,8 +302,8 @@ _GROUNDMESSAGE = _descriptor.Descriptor( @@ -295,8 +302,8 @@ _GROUNDMESSAGE = _descriptor.Descriptor(
name='ground_message', full_name='uas.ugv.messages.GroundMessage.ground_message',
index=0, containing_type=None, fields=[]),
],
serialized_start=409,
serialized_end=494,
serialized_start=428,
serialized_end=513,
)
_UGV_STATUS.fields_by_name['state'].enum_type = _UGV_STATE

1
main/messages.proto

@ -22,6 +22,7 @@ message Location { @@ -22,6 +22,7 @@ message Location {
message UGV_Status {
UGV_State state = 1;
Location location = 2;
float yaw_angle = 3;
}
message UGV_Message {

1
main/ugv_comms.cc

@ -178,6 +178,7 @@ void CommsClass::RunTask() { @@ -178,6 +178,7 @@ void CommsClass::RunTask() {
Lock();
status->mutable_location()->CopyFrom(this->location);
status->set_yaw_angle(this->yaw_angle);
status->set_state(this->ugv_state);
Unlock();
ugv_message.SerializeToString(&ugv_message_data);

3
main/ugv_comms.hh

@ -19,7 +19,7 @@ namespace messages = uas::ugv::messages; @@ -19,7 +19,7 @@ namespace messages = uas::ugv::messages;
class CommsClass {
public:
static constexpr int MAX_PACKET_LEN = 128;
static constexpr int MAX_PACKET_LEN = 128;
static constexpr TickType_t PACKET_RX_TIMEOUT = pdMS_TO_TICKS(200);
CommsClass();
@ -35,6 +35,7 @@ class CommsClass { @@ -35,6 +35,7 @@ class CommsClass {
public:
SemaphoreHandle_t mutex;
messages::Location location;
float yaw_angle;
messages::UGV_State ugv_state;
TickType_t last_packet_tick;
int32_t last_packet_rssi;

Loading…
Cancel
Save