diff --git a/mars_rover/cFS/apps/run_app/CMakeLists.txt b/mars_rover/cFS/apps/run_app/CMakeLists.txt new file mode 100644 index 0000000..fe32de4 --- /dev/null +++ b/mars_rover/cFS/apps/run_app/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.6.4) +project(CFE_RUN_APP C) + +include_directories(fsw/mission_inc) +include_directories(fsw/platform_inc) + +aux_source_directory(fsw/src APP_SRC_FILES) + +# Create the app module +add_cfe_app(run_app ${APP_SRC_FILES}) + +target_link_libraries(run_app + ${PROTOBUF_LIBRARY} + protobuf-c +) \ No newline at end of file diff --git a/mars_rover/cFS/apps/run_app/fsw/mission_inc/run_app_perfids.h b/mars_rover/cFS/apps/run_app/fsw/mission_inc/run_app_perfids.h new file mode 100644 index 0000000..643eeec --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/mission_inc/run_app_perfids.h @@ -0,0 +1,7 @@ +#ifndef _run_app_perfids_h_ +#define _run_app_perfids_h_ + + +#define SAMPLE_APP_PERF_ID 91 + +#endif /* _run_app_perfids_h_ */ diff --git a/mars_rover/cFS/apps/run_app/fsw/platform_inc/run_app_msgids.h b/mars_rover/cFS/apps/run_app/fsw/platform_inc/run_app_msgids.h new file mode 100644 index 0000000..0a44407 --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/platform_inc/run_app_msgids.h @@ -0,0 +1,9 @@ +#ifndef _run_app_msgids_h_ +#define _run_app_msgids_h_ + +#define RUN_APP_CMD_MID 0x1892 +#define RUN_APP_SEND_HK_MID 0x1893 +#define RUN_APP_HK_TLM_MID 0x0893 +#define RACS2_BRIDGE_MID 0x1EFE + +#endif /* _run_app_msgids_h_ */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/RACS2Brdige_std_msgs.pb-c.c b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Brdige_std_msgs.pb-c.c new file mode 100644 index 0000000..0512d65 --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Brdige_std_msgs.pb-c.c @@ -0,0 +1,261 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RACS2Brdige_std_msgs.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "RACS2Brdige_std_msgs.pb-c.h" +void racs2_bridge_std_msgs__init + (RACS2BridgeStdMsgs *message) +{ + static const RACS2BridgeStdMsgs init_value = RACS2_BRIDGE_STD_MSGS__INIT; + *message = init_value; +} +size_t racs2_bridge_std_msgs__get_packed_size + (const RACS2BridgeStdMsgs *message) +{ + assert(message->base.descriptor == &racs2_bridge_std_msgs__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t racs2_bridge_std_msgs__pack + (const RACS2BridgeStdMsgs *message, + uint8_t *out) +{ + assert(message->base.descriptor == &racs2_bridge_std_msgs__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t racs2_bridge_std_msgs__pack_to_buffer + (const RACS2BridgeStdMsgs *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &racs2_bridge_std_msgs__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RACS2BridgeStdMsgs * + racs2_bridge_std_msgs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RACS2BridgeStdMsgs *) + protobuf_c_message_unpack (&racs2_bridge_std_msgs__descriptor, + allocator, len, data); +} +void racs2_bridge_std_msgs__free_unpacked + (RACS2BridgeStdMsgs *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &racs2_bridge_std_msgs__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor racs2_bridge_std_msgs__field_descriptors[14] = +{ + { + "bool_data", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(RACS2BridgeStdMsgs, has_bool_data), + offsetof(RACS2BridgeStdMsgs, bool_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "float_data", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeStdMsgs, has_float_data), + offsetof(RACS2BridgeStdMsgs, float_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "double_data", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(RACS2BridgeStdMsgs, has_double_data), + offsetof(RACS2BridgeStdMsgs, double_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "int32_data", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(RACS2BridgeStdMsgs, has_int32_data), + offsetof(RACS2BridgeStdMsgs, int32_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "int64_data", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT64, + offsetof(RACS2BridgeStdMsgs, has_int64_data), + offsetof(RACS2BridgeStdMsgs, int64_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "string_data", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(RACS2BridgeStdMsgs, string_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "uint32_data", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(RACS2BridgeStdMsgs, has_uint32_data), + offsetof(RACS2BridgeStdMsgs, uint32_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "uint64_data", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT64, + offsetof(RACS2BridgeStdMsgs, has_uint64_data), + offsetof(RACS2BridgeStdMsgs, uint64_data), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "float32_array_data", + 9, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeStdMsgs, n_float32_array_data), + offsetof(RACS2BridgeStdMsgs, float32_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "float64_array_data", + 10, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(RACS2BridgeStdMsgs, n_float64_array_data), + offsetof(RACS2BridgeStdMsgs, float64_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "int32_array_data", + 11, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_INT32, + offsetof(RACS2BridgeStdMsgs, n_int32_array_data), + offsetof(RACS2BridgeStdMsgs, int32_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "int64_array_data", + 12, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_INT64, + offsetof(RACS2BridgeStdMsgs, n_int64_array_data), + offsetof(RACS2BridgeStdMsgs, int64_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "uint32_array_data", + 13, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_UINT32, + offsetof(RACS2BridgeStdMsgs, n_uint32_array_data), + offsetof(RACS2BridgeStdMsgs, uint32_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "uint64_array_data", + 14, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_UINT64, + offsetof(RACS2BridgeStdMsgs, n_uint64_array_data), + offsetof(RACS2BridgeStdMsgs, uint64_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned racs2_bridge_std_msgs__field_indices_by_name[] = { + 0, /* field[0] = bool_data */ + 2, /* field[2] = double_data */ + 8, /* field[8] = float32_array_data */ + 9, /* field[9] = float64_array_data */ + 1, /* field[1] = float_data */ + 10, /* field[10] = int32_array_data */ + 3, /* field[3] = int32_data */ + 11, /* field[11] = int64_array_data */ + 4, /* field[4] = int64_data */ + 5, /* field[5] = string_data */ + 12, /* field[12] = uint32_array_data */ + 6, /* field[6] = uint32_data */ + 13, /* field[13] = uint64_array_data */ + 7, /* field[7] = uint64_data */ +}; +static const ProtobufCIntRange racs2_bridge_std_msgs__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 14 } +}; +const ProtobufCMessageDescriptor racs2_bridge_std_msgs__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "RACS2Bridge_std_msgs", + "RACS2BridgeStdMsgs", + "RACS2BridgeStdMsgs", + "", + sizeof(RACS2BridgeStdMsgs), + 14, + racs2_bridge_std_msgs__field_descriptors, + racs2_bridge_std_msgs__field_indices_by_name, + 1, racs2_bridge_std_msgs__number_ranges, + (ProtobufCMessageInit) racs2_bridge_std_msgs__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/mars_rover/cFS/apps/run_app/fsw/src/RACS2Brdige_std_msgs.pb-c.h b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Brdige_std_msgs.pb-c.h new file mode 100644 index 0000000..54a70aa --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Brdige_std_msgs.pb-c.h @@ -0,0 +1,139 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RACS2Brdige_std_msgs.proto */ + +#ifndef PROTOBUF_C_RACS2Brdige_5fstd_5fmsgs_2eproto__INCLUDED +#define PROTOBUF_C_RACS2Brdige_5fstd_5fmsgs_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1000000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _RACS2BridgeStdMsgs RACS2BridgeStdMsgs; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _RACS2BridgeStdMsgs +{ + ProtobufCMessage base; + /* + * -- std_msgs/Bool --------------------------- + */ + protobuf_c_boolean has_bool_data; + protobuf_c_boolean bool_data; + /* + * -- std_msgs/Float32 --------------------------- + */ + protobuf_c_boolean has_float_data; + float float_data; + /* + * -- std_msgs/Float64 --------------------------- + */ + protobuf_c_boolean has_double_data; + double double_data; + /* + * -- std_msgs/Int32 --------------------------- + */ + protobuf_c_boolean has_int32_data; + int32_t int32_data; + /* + * -- std_msgs/Int64 --------------------------- + */ + protobuf_c_boolean has_int64_data; + int64_t int64_data; + /* + * -- std_msgs/String --------------------------- + */ + char *string_data; + /* + * -- std_msgs/Uint32 --------------------------- + */ + protobuf_c_boolean has_uint32_data; + uint32_t uint32_data; + /* + * -- std_msgs/Uint64 --------------------------- + */ + protobuf_c_boolean has_uint64_data; + uint64_t uint64_data; + /* + * -- std_msgs/Float32MultiArray --------------------------- + */ + size_t n_float32_array_data; + float *float32_array_data; + /* + * -- std_msgs/Float64MultiArray --------------------------- + */ + size_t n_float64_array_data; + double *float64_array_data; + /* + * -- std_msgs/Int32MultiArray --------------------------- + */ + size_t n_int32_array_data; + int32_t *int32_array_data; + /* + * -- std_msgs/Int64MultiArray --------------------------- + */ + size_t n_int64_array_data; + int64_t *int64_array_data; + /* + * -- std_msgs/Uint32MultiArray --------------------------- + */ + size_t n_uint32_array_data; + uint32_t *uint32_array_data; + /* + * -- std_msgs/Uint64MultiArray --------------------------- + */ + size_t n_uint64_array_data; + uint64_t *uint64_array_data; +}; +#define RACS2_BRIDGE_STD_MSGS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&racs2_bridge_std_msgs__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } + + +/* RACS2BridgeStdMsgs methods */ +void racs2_bridge_std_msgs__init + (RACS2BridgeStdMsgs *message); +size_t racs2_bridge_std_msgs__get_packed_size + (const RACS2BridgeStdMsgs *message); +size_t racs2_bridge_std_msgs__pack + (const RACS2BridgeStdMsgs *message, + uint8_t *out); +size_t racs2_bridge_std_msgs__pack_to_buffer + (const RACS2BridgeStdMsgs *message, + ProtobufCBuffer *buffer); +RACS2BridgeStdMsgs * + racs2_bridge_std_msgs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void racs2_bridge_std_msgs__free_unpacked + (RACS2BridgeStdMsgs *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*RACS2BridgeStdMsgs_Closure) + (const RACS2BridgeStdMsgs *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor racs2_bridge_std_msgs__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_RACS2Brdige_5fstd_5fmsgs_2eproto__INCLUDED */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/RACS2Bridge_geometry_msgs.pb-c.c b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Bridge_geometry_msgs.pb-c.c new file mode 100644 index 0000000..d26ed5e --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Bridge_geometry_msgs.pb-c.c @@ -0,0 +1,622 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RACS2Bridge_geometry_msgs.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "RACS2Bridge_geometry_msgs.pb-c.h" +void racs2_bridge_geometry_msgs__vector3__init + (RACS2BridgeGeometryMsgsVector3 *message) +{ + static const RACS2BridgeGeometryMsgsVector3 init_value = RACS2_BRIDGE_GEOMETRY_MSGS__VECTOR3__INIT; + *message = init_value; +} +size_t racs2_bridge_geometry_msgs__vector3__get_packed_size + (const RACS2BridgeGeometryMsgsVector3 *message) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__vector3__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t racs2_bridge_geometry_msgs__vector3__pack + (const RACS2BridgeGeometryMsgsVector3 *message, + uint8_t *out) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__vector3__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t racs2_bridge_geometry_msgs__vector3__pack_to_buffer + (const RACS2BridgeGeometryMsgsVector3 *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__vector3__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RACS2BridgeGeometryMsgsVector3 * + racs2_bridge_geometry_msgs__vector3__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RACS2BridgeGeometryMsgsVector3 *) + protobuf_c_message_unpack (&racs2_bridge_geometry_msgs__vector3__descriptor, + allocator, len, data); +} +void racs2_bridge_geometry_msgs__vector3__free_unpacked + (RACS2BridgeGeometryMsgsVector3 *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__vector3__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void racs2_bridge_geometry_msgs__twist__init + (RACS2BridgeGeometryMsgsTwist *message) +{ + static const RACS2BridgeGeometryMsgsTwist init_value = RACS2_BRIDGE_GEOMETRY_MSGS__TWIST__INIT; + *message = init_value; +} +size_t racs2_bridge_geometry_msgs__twist__get_packed_size + (const RACS2BridgeGeometryMsgsTwist *message) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__twist__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t racs2_bridge_geometry_msgs__twist__pack + (const RACS2BridgeGeometryMsgsTwist *message, + uint8_t *out) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__twist__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t racs2_bridge_geometry_msgs__twist__pack_to_buffer + (const RACS2BridgeGeometryMsgsTwist *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__twist__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RACS2BridgeGeometryMsgsTwist * + racs2_bridge_geometry_msgs__twist__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RACS2BridgeGeometryMsgsTwist *) + protobuf_c_message_unpack (&racs2_bridge_geometry_msgs__twist__descriptor, + allocator, len, data); +} +void racs2_bridge_geometry_msgs__twist__free_unpacked + (RACS2BridgeGeometryMsgsTwist *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__twist__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +void racs2_bridge_geometry_msgs__init + (RACS2BridgeGeometryMsgs *message) +{ + static const RACS2BridgeGeometryMsgs init_value = RACS2_BRIDGE_GEOMETRY_MSGS__INIT; + *message = init_value; +} +size_t racs2_bridge_geometry_msgs__get_packed_size + (const RACS2BridgeGeometryMsgs *message) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t racs2_bridge_geometry_msgs__pack + (const RACS2BridgeGeometryMsgs *message, + uint8_t *out) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t racs2_bridge_geometry_msgs__pack_to_buffer + (const RACS2BridgeGeometryMsgs *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +RACS2BridgeGeometryMsgs * + racs2_bridge_geometry_msgs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (RACS2BridgeGeometryMsgs *) + protobuf_c_message_unpack (&racs2_bridge_geometry_msgs__descriptor, + allocator, len, data); +} +void racs2_bridge_geometry_msgs__free_unpacked + (RACS2BridgeGeometryMsgs *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &racs2_bridge_geometry_msgs__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor racs2_bridge_geometry_msgs__vector3__field_descriptors[3] = +{ + { + "x", + 1, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ + offsetof(RACS2BridgeGeometryMsgsVector3, x), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "y", + 2, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ + offsetof(RACS2BridgeGeometryMsgsVector3, y), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "z", + 3, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_DOUBLE, + 0, /* quantifier_offset */ + offsetof(RACS2BridgeGeometryMsgsVector3, z), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned racs2_bridge_geometry_msgs__vector3__field_indices_by_name[] = { + 0, /* field[0] = x */ + 1, /* field[1] = y */ + 2, /* field[2] = z */ +}; +static const ProtobufCIntRange racs2_bridge_geometry_msgs__vector3__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor racs2_bridge_geometry_msgs__vector3__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "RACS2Bridge_geometry_msgs_Vector3", + "RACS2BridgeGeometryMsgsVector3", + "RACS2BridgeGeometryMsgsVector3", + "", + sizeof(RACS2BridgeGeometryMsgsVector3), + 3, + racs2_bridge_geometry_msgs__vector3__field_descriptors, + racs2_bridge_geometry_msgs__vector3__field_indices_by_name, + 1, racs2_bridge_geometry_msgs__vector3__number_ranges, + (ProtobufCMessageInit) racs2_bridge_geometry_msgs__vector3__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor racs2_bridge_geometry_msgs__twist__field_descriptors[2] = +{ + { + "linear", + 1, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RACS2BridgeGeometryMsgsTwist, linear), + &racs2_bridge_geometry_msgs__vector3__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "angular", + 2, + PROTOBUF_C_LABEL_REQUIRED, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(RACS2BridgeGeometryMsgsTwist, angular), + &racs2_bridge_geometry_msgs__vector3__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned racs2_bridge_geometry_msgs__twist__field_indices_by_name[] = { + 1, /* field[1] = angular */ + 0, /* field[0] = linear */ +}; +static const ProtobufCIntRange racs2_bridge_geometry_msgs__twist__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor racs2_bridge_geometry_msgs__twist__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "RACS2Bridge_geometry_msgs_Twist", + "RACS2BridgeGeometryMsgsTwist", + "RACS2BridgeGeometryMsgsTwist", + "", + sizeof(RACS2BridgeGeometryMsgsTwist), + 2, + racs2_bridge_geometry_msgs__twist__field_descriptors, + racs2_bridge_geometry_msgs__twist__field_indices_by_name, + 1, racs2_bridge_geometry_msgs__twist__number_ranges, + (ProtobufCMessageInit) racs2_bridge_geometry_msgs__twist__init, + NULL,NULL,NULL /* reserved[123] */ +}; +static const ProtobufCFieldDescriptor racs2_bridge_geometry_msgs__field_descriptors[26] = +{ + { + "accel_with_covariance_data", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_accel_with_covariance_data), + offsetof(RACS2BridgeGeometryMsgs, accel_with_covariance_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "accel_with_covariance_stamped_data", + 2, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_accel_with_covariance_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, accel_with_covariance_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "point_stamped_data", + 3, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_point_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, point_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "inertia_stamped_data", + 4, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_inertia_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, inertia_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "quaternion_stamped_data", + 5, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_quaternion_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, quaternion_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "transform_stamped_data", + 6, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_transform_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, transform_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "inertia_data", + 7, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_inertia_data), + offsetof(RACS2BridgeGeometryMsgs, inertia_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pose_with_covariance_data", + 8, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_pose_with_covariance_data), + offsetof(RACS2BridgeGeometryMsgs, pose_with_covariance_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "twist_covariance_stamped_data", + 9, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_twist_covariance_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, twist_covariance_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "wrench_data", + 10, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_wrench_data), + offsetof(RACS2BridgeGeometryMsgs, wrench_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "accel_data", + 11, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_accel_data), + offsetof(RACS2BridgeGeometryMsgs, accel_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pose_with_covariance_stamped_data", + 12, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_pose_with_covariance_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, pose_with_covariance_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "accele_stamped_data", + 13, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_accele_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, accele_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "transform_data", + 14, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_transform_data), + offsetof(RACS2BridgeGeometryMsgs, transform_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "point_data", + 15, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_point_data), + offsetof(RACS2BridgeGeometryMsgs, point_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "polygon_stamped_dta", + 16, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_polygon_stamped_dta), + offsetof(RACS2BridgeGeometryMsgs, polygon_stamped_dta), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pose_array_data", + 17, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_pose_array_data), + offsetof(RACS2BridgeGeometryMsgs, pose_array_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "vector3_stamped_data", + 18, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_vector3_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, vector3_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pose_stamped_data", + 19, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_pose_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, pose_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "polygon_data", + 20, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_polygon_data), + offsetof(RACS2BridgeGeometryMsgs, polygon_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "queaternion_data", + 21, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_queaternion_data), + offsetof(RACS2BridgeGeometryMsgs, queaternion_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "point32_data", + 22, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_point32_data), + offsetof(RACS2BridgeGeometryMsgs, point32_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "twist_with_covariance_data", + 23, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_twist_with_covariance_data), + offsetof(RACS2BridgeGeometryMsgs, twist_with_covariance_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pose_data", + 24, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_pose_data), + offsetof(RACS2BridgeGeometryMsgs, pose_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "twist_stamped_data", + 25, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_twist_stamped_data), + offsetof(RACS2BridgeGeometryMsgs, twist_stamped_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "pose_2d_data", + 26, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_FLOAT, + offsetof(RACS2BridgeGeometryMsgs, n_pose_2d_data), + offsetof(RACS2BridgeGeometryMsgs, pose_2d_data), + NULL, + NULL, + 0 | PROTOBUF_C_FIELD_FLAG_PACKED, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned racs2_bridge_geometry_msgs__field_indices_by_name[] = { + 10, /* field[10] = accel_data */ + 0, /* field[0] = accel_with_covariance_data */ + 1, /* field[1] = accel_with_covariance_stamped_data */ + 12, /* field[12] = accele_stamped_data */ + 6, /* field[6] = inertia_data */ + 3, /* field[3] = inertia_stamped_data */ + 21, /* field[21] = point32_data */ + 14, /* field[14] = point_data */ + 2, /* field[2] = point_stamped_data */ + 19, /* field[19] = polygon_data */ + 15, /* field[15] = polygon_stamped_dta */ + 25, /* field[25] = pose_2d_data */ + 16, /* field[16] = pose_array_data */ + 23, /* field[23] = pose_data */ + 18, /* field[18] = pose_stamped_data */ + 7, /* field[7] = pose_with_covariance_data */ + 11, /* field[11] = pose_with_covariance_stamped_data */ + 4, /* field[4] = quaternion_stamped_data */ + 20, /* field[20] = queaternion_data */ + 13, /* field[13] = transform_data */ + 5, /* field[5] = transform_stamped_data */ + 8, /* field[8] = twist_covariance_stamped_data */ + 24, /* field[24] = twist_stamped_data */ + 22, /* field[22] = twist_with_covariance_data */ + 17, /* field[17] = vector3_stamped_data */ + 9, /* field[9] = wrench_data */ +}; +static const ProtobufCIntRange racs2_bridge_geometry_msgs__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 26 } +}; +const ProtobufCMessageDescriptor racs2_bridge_geometry_msgs__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "RACS2Bridge_geometry_msgs", + "RACS2BridgeGeometryMsgs", + "RACS2BridgeGeometryMsgs", + "", + sizeof(RACS2BridgeGeometryMsgs), + 26, + racs2_bridge_geometry_msgs__field_descriptors, + racs2_bridge_geometry_msgs__field_indices_by_name, + 1, racs2_bridge_geometry_msgs__number_ranges, + (ProtobufCMessageInit) racs2_bridge_geometry_msgs__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/mars_rover/cFS/apps/run_app/fsw/src/RACS2Bridge_geometry_msgs.pb-c.h b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Bridge_geometry_msgs.pb-c.h new file mode 100644 index 0000000..f069dba --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/RACS2Bridge_geometry_msgs.pb-c.h @@ -0,0 +1,277 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: RACS2Bridge_geometry_msgs.proto */ + +#ifndef PROTOBUF_C_RACS2Bridge_5fgeometry_5fmsgs_2eproto__INCLUDED +#define PROTOBUF_C_RACS2Bridge_5fgeometry_5fmsgs_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1000000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _RACS2BridgeGeometryMsgsVector3 RACS2BridgeGeometryMsgsVector3; +typedef struct _RACS2BridgeGeometryMsgsTwist RACS2BridgeGeometryMsgsTwist; +typedef struct _RACS2BridgeGeometryMsgs RACS2BridgeGeometryMsgs; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _RACS2BridgeGeometryMsgsVector3 +{ + ProtobufCMessage base; + /* + * -- geometry_msgs/Vector3 ---------------------------- + */ + double x; + double y; + double z; +}; +#define RACS2_BRIDGE_GEOMETRY_MSGS__VECTOR3__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&racs2_bridge_geometry_msgs__vector3__descriptor) \ + , 0, 0, 0 } + + +struct _RACS2BridgeGeometryMsgsTwist +{ + ProtobufCMessage base; + /* + * -- geometry_msgs/Twist ------------------------------ + */ + RACS2BridgeGeometryMsgsVector3 *linear; + RACS2BridgeGeometryMsgsVector3 *angular; +}; +#define RACS2_BRIDGE_GEOMETRY_MSGS__TWIST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&racs2_bridge_geometry_msgs__twist__descriptor) \ + , NULL, NULL } + + +struct _RACS2BridgeGeometryMsgs +{ + ProtobufCMessage base; + /* + * -- geometry_msgs/AccelWithCovariance ---------------- + */ + size_t n_accel_with_covariance_data; + float *accel_with_covariance_data; + /* + * -- geometry_msgs/AccelWithCovarianceStamped --------- + */ + size_t n_accel_with_covariance_stamped_data; + float *accel_with_covariance_stamped_data; + /* + * -- geometry_msgs/PointStamped ----------------------- + */ + size_t n_point_stamped_data; + float *point_stamped_data; + /* + * -- geometry_msgs/InertiaStamped --------------------- + */ + size_t n_inertia_stamped_data; + float *inertia_stamped_data; + /* + * -- geometry_msgs/QuaternionStamped ------------------ + */ + size_t n_quaternion_stamped_data; + float *quaternion_stamped_data; + /* + * -- geometry_msgs/TransformStamped ------------------- + */ + size_t n_transform_stamped_data; + float *transform_stamped_data; + /* + * -- geometry_msgs/Inertia ---------------------------- + */ + size_t n_inertia_data; + float *inertia_data; + /* + * -- geometry_msgs/PoseWithCovariance ----------------- + */ + size_t n_pose_with_covariance_data; + float *pose_with_covariance_data; + /* + * -- geometry_msgs/TwistWithCovarianceStamped --------- + */ + size_t n_twist_covariance_stamped_data; + float *twist_covariance_stamped_data; + /* + * -- geometry_msgs/Wrench ----------------------------- + */ + size_t n_wrench_data; + float *wrench_data; + /* + * -- geometry_msgs/Accel ------------------------------ + */ + size_t n_accel_data; + float *accel_data; + /* + * -- geometry_msgs/PoseWithCovarianceStamped ---------- + */ + size_t n_pose_with_covariance_stamped_data; + float *pose_with_covariance_stamped_data; + /* + * -- geometry_msgs/AccelStamped ----------------------- + */ + size_t n_accele_stamped_data; + float *accele_stamped_data; + /* + * -- geometry_msgs/Transform -------------------------- + */ + size_t n_transform_data; + float *transform_data; + /* + * -- geometry_msgs/Point ------------------------------ + */ + size_t n_point_data; + float *point_data; + /* + * -- geometry_msgs/PolygonStamped --------------------- + */ + size_t n_polygon_stamped_dta; + float *polygon_stamped_dta; + /* + * -- geometry_msgs/PoseArray -------------------------- + */ + size_t n_pose_array_data; + float *pose_array_data; + /* + * -- geometry_msgs/Vector3Stamped --------------------- + */ + size_t n_vector3_stamped_data; + float *vector3_stamped_data; + /* + * -- geometry_msgs/PoseStamped ------------------------ + */ + size_t n_pose_stamped_data; + float *pose_stamped_data; + /* + * -- geometry_msgs/Polygon ---------------------------- + */ + size_t n_polygon_data; + float *polygon_data; + /* + * -- geometry_msgs/Quaternion ------------------------- + */ + size_t n_queaternion_data; + float *queaternion_data; + /* + * -- geometry_msgs/Point32 ---------------------------- + */ + size_t n_point32_data; + float *point32_data; + /* + * -- geometry_msgs/TwistWithCovariance ---------------- + */ + size_t n_twist_with_covariance_data; + float *twist_with_covariance_data; + /* + * -- geometry_msgs/Pose ------------------------------- + */ + size_t n_pose_data; + float *pose_data; + /* + * -- geometry_msgs/TwistStamped ----------------------- + */ + size_t n_twist_stamped_data; + float *twist_stamped_data; + /* + * -- geometry_msgs/Pose2D ----------------------------- + */ + size_t n_pose_2d_data; + float *pose_2d_data; +}; +#define RACS2_BRIDGE_GEOMETRY_MSGS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&racs2_bridge_geometry_msgs__descriptor) \ + , 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } + + +/* RACS2BridgeGeometryMsgsVector3 methods */ +void racs2_bridge_geometry_msgs__vector3__init + (RACS2BridgeGeometryMsgsVector3 *message); +size_t racs2_bridge_geometry_msgs__vector3__get_packed_size + (const RACS2BridgeGeometryMsgsVector3 *message); +size_t racs2_bridge_geometry_msgs__vector3__pack + (const RACS2BridgeGeometryMsgsVector3 *message, + uint8_t *out); +size_t racs2_bridge_geometry_msgs__vector3__pack_to_buffer + (const RACS2BridgeGeometryMsgsVector3 *message, + ProtobufCBuffer *buffer); +RACS2BridgeGeometryMsgsVector3 * + racs2_bridge_geometry_msgs__vector3__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void racs2_bridge_geometry_msgs__vector3__free_unpacked + (RACS2BridgeGeometryMsgsVector3 *message, + ProtobufCAllocator *allocator); +/* RACS2BridgeGeometryMsgsTwist methods */ +void racs2_bridge_geometry_msgs__twist__init + (RACS2BridgeGeometryMsgsTwist *message); +size_t racs2_bridge_geometry_msgs__twist__get_packed_size + (const RACS2BridgeGeometryMsgsTwist *message); +size_t racs2_bridge_geometry_msgs__twist__pack + (const RACS2BridgeGeometryMsgsTwist *message, + uint8_t *out); +size_t racs2_bridge_geometry_msgs__twist__pack_to_buffer + (const RACS2BridgeGeometryMsgsTwist *message, + ProtobufCBuffer *buffer); +RACS2BridgeGeometryMsgsTwist * + racs2_bridge_geometry_msgs__twist__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void racs2_bridge_geometry_msgs__twist__free_unpacked + (RACS2BridgeGeometryMsgsTwist *message, + ProtobufCAllocator *allocator); +/* RACS2BridgeGeometryMsgs methods */ +void racs2_bridge_geometry_msgs__init + (RACS2BridgeGeometryMsgs *message); +size_t racs2_bridge_geometry_msgs__get_packed_size + (const RACS2BridgeGeometryMsgs *message); +size_t racs2_bridge_geometry_msgs__pack + (const RACS2BridgeGeometryMsgs *message, + uint8_t *out); +size_t racs2_bridge_geometry_msgs__pack_to_buffer + (const RACS2BridgeGeometryMsgs *message, + ProtobufCBuffer *buffer); +RACS2BridgeGeometryMsgs * + racs2_bridge_geometry_msgs__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void racs2_bridge_geometry_msgs__free_unpacked + (RACS2BridgeGeometryMsgs *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*RACS2BridgeGeometryMsgsVector3_Closure) + (const RACS2BridgeGeometryMsgsVector3 *message, + void *closure_data); +typedef void (*RACS2BridgeGeometryMsgsTwist_Closure) + (const RACS2BridgeGeometryMsgsTwist *message, + void *closure_data); +typedef void (*RACS2BridgeGeometryMsgs_Closure) + (const RACS2BridgeGeometryMsgs *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor racs2_bridge_geometry_msgs__vector3__descriptor; +extern const ProtobufCMessageDescriptor racs2_bridge_geometry_msgs__twist__descriptor; +extern const ProtobufCMessageDescriptor racs2_bridge_geometry_msgs__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_RACS2Bridge_5fgeometry_5fmsgs_2eproto__INCLUDED */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/racs2_user_msg.h b/mars_rover/cFS/apps/run_app/fsw/src/racs2_user_msg.h new file mode 100644 index 0000000..84dc66a --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/racs2_user_msg.h @@ -0,0 +1,22 @@ +#ifndef _racs2_user_msg_h_ +#define _racs2_user_msg_h_ + +/* +** Type definition (user data format for racs2 bridge) +*/ +#define ROS2_TOPIC_NAME_LNGTH 32 +#define BODY_DATA_MAX_LNGTH 128 + +typedef struct +{ + uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; + char ros2_topic_name[ROS2_TOPIC_NAME_LNGTH]; + uint8 body_data_length; + uint8 body_data[BODY_DATA_MAX_LNGTH]; + +} OS_PACK racs2_user_msg_t ; + +#define RACS2_USER_MSG_LNGTH sizeof ( racs2_user_msg_t ) +#define RACS2_BRIDGE_USER_LISTENER_LNGTH sizeof ( racs2_user_msg_t ) + +#endif /* _racs2_user_msg_h_ */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/run_app.c b/mars_rover/cFS/apps/run_app/fsw/src/run_app.c new file mode 100644 index 0000000..3b87cd9 --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/run_app.c @@ -0,0 +1,436 @@ +/* +** Include Files: +*/ + +#include "run_app.h" +#include "run_app_perfids.h" +#include "run_app_msgids.h" +#include "run_app_msg.h" +#include "racs2_user_msg.h" +#include "run_app_events.h" +#include "run_app_version.h" +#include "RACS2Bridge_geometry_msgs.pb-c.h" + +#include +#include +#include +#include +#include +#include + +/* +** global data +*/ + +sample_hk_tlm_t RUN_APP_HkTelemetryPkt; +racs2_user_msg_t RACS2_UserMsgPkt; +CFE_SB_PipeId_t RUN_APP_CommandPipe; +CFE_SB_MsgPtr_t RUN_APP_MsgPtr; + +typedef enum { + FORWARD, + BACKWARD, + TURN_RIGHT, + TURN_LEFT, + STOP +} Command; + +Command current_command = STOP; +struct termios original_termios; + +double twist_linear_x = 0.0; +double twist_linear_y = 0.0; +double twist_linear_z = 0.0; +double twist_angular_x = 0.0; +double twist_angular_y = 0.0; +double twist_angular_z = 0.0; + +static CFE_EVS_BinFilter_t SAMPLE_EventFilters[] = + { /* Event ID mask */ + {SAMPLE_STARTUP_INF_EID, 0x0000}, + {SAMPLE_COMMAND_ERR_EID, 0x0000}, + {SAMPLE_COMMANDNOP_INF_EID, 0x0000}, + {SAMPLE_COMMANDRST_INF_EID, 0x0000}, + }; + + +void send_command(Command cmd) { + switch (cmd) { + case FORWARD: + printf("Moving Forward\n"); + twist_linear_x = 2.0; + break; + case BACKWARD: + printf("Moving Backward\n"); + twist_linear_x = -2.0; + break; + case TURN_RIGHT: + printf("Turning Right\n"); + twist_linear_x = 1.0; + twist_angular_z = -0.4; + break; + case TURN_LEFT: + printf("Turning Left\n"); + twist_linear_x = 1.0; + twist_angular_z = 0.4; + break; + case STOP: + printf("Stopping\n"); + twist_linear_x = 0.0; + twist_linear_y = 0.0; + twist_linear_z = 0.0; + twist_angular_x = 0.0; + twist_angular_y = 0.0; + twist_angular_z = 0.0; + break; + } +} + +void process_input(char input) { + switch (input) { + case 'w': + current_command = FORWARD; + printf("###### Moving Forward ###### \n"); + twist_linear_x = 2.0; + break; + case 's': + current_command = BACKWARD; + printf("###### Moving Backward ###### \n"); + twist_linear_x = -2.0; + break; + case 'd': + current_command = TURN_RIGHT; + printf("###### Turning Right ###### \n"); + twist_linear_x = 1.0; + twist_angular_z = -0.4; + break; + case 'a': + current_command = TURN_LEFT; + printf("###### Turning Left ###### \n"); + twist_linear_x = 1.0; + twist_angular_z = 0.4; + break; + case 'x': + current_command = STOP; + printf("###### Stopping ###### \n"); + twist_linear_x = 0.0; + twist_linear_y = 0.0; + twist_linear_z = 0.0; + twist_angular_x = 0.0; + twist_angular_y = 0.0; + twist_angular_z = 0.0; + break; + default: + printf("!!!!! Invalid input !!!!! \n"); + return; + } +} + +void set_non_canonical_mode(int fd) { + struct termios termios; + + // 現在の端末設定を取得 + tcgetattr(fd, &original_termios); + + // 設定を変更 + termios = original_termios; + termios.c_lflag &= ~(ICANON | ECHO); // 非カノニカルモード、エコーを無効にする + + // 変更を適用 + tcsetattr(fd, TCSANOW, &termios); +} + +void restore_canonical_mode(int fd) { + tcsetattr(fd, TCSANOW, &original_termios); +} + +void signal_handler(int signum) { + // 端末設定を元に戻す + restore_canonical_mode(fileno(stdin)); + printf("\nTerminating program.\n"); + exit(0); +} + + +/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* RUN_APP_Main() -- Application entry point and main process loop */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +void RUN_APP_Main( void ) +{ + int32 status; + uint32 RunStatus = CFE_ES_RunStatus_APP_RUN; + + OS_printf("RUN_APP_Main starts.\n"); + + CFE_ES_PerfLogEntry(SAMPLE_APP_PERF_ID); + + SAMPLE_TAKLKER_Init(); + + struct termios original_termios; + char input; + signal(SIGINT, signal_handler); + + /* + ** RUN_APP Runloop + */ + + int fd = fileno(stdin); + set_non_canonical_mode(fd); + + int count = 0; + while (CFE_ES_RunLoop(&RunStatus) == true) + { + if (read(fd, &input, 1) == 1) { + process_input(input); + } + + CFE_ES_PerfLogExit(SAMPLE_APP_PERF_ID); + + // /* Pend on receipt of command packet -- timeout set to 500 millisecs */ + // status = CFE_SB_RcvMsg(&RUN_APP_MsgPtr, RUN_APP_CommandPipe, 500); + + CFE_ES_PerfLogEntry(SAMPLE_APP_PERF_ID); + + // if (status == CFE_SUCCESS) + // { + // RUN_APP_ProcessCommandPacket(); + // } + sleep(2); + + // send message + // set topic name + strcpy(RACS2_UserMsgPkt.ros2_topic_name, "/cmd_vel"); + // define serialized body data + uint8_t *buffer; + + RACS2BridgeGeometryMsgsVector3 linear = RACS2_BRIDGE_GEOMETRY_MSGS__VECTOR3__INIT; + RACS2BridgeGeometryMsgsVector3 angular = RACS2_BRIDGE_GEOMETRY_MSGS__VECTOR3__INIT; + RACS2BridgeGeometryMsgsTwist message = RACS2_BRIDGE_GEOMETRY_MSGS__TWIST__INIT; + + message.linear = &linear; + message.angular = &angular; + message.linear->x = twist_linear_x; + message.linear->y = twist_linear_y; + message.linear->z = twist_linear_z; + message.angular->x = twist_angular_x; + message.angular->y = twist_angular_y; + message.angular->z = twist_angular_z; + // message.linear->x = 2.0; + // message.linear->y = 0.0; + // message.linear->z = 0.0; + // message.angular->x = 0.0; + // message.angular->y = 0.0; + // message.angular->z = 0.0; + + OS_printf("RUN_APP: [Send][MsgID=0x%x][linear: x = %5.2f, y = %5.2f, z = %5.2f][angular: x = %5.2f, y = %5.2f, z = %5.2f]\n", + RACS2_BRIDGE_MID, + message.linear->x, + message.linear->y, + message.linear->z, + message.angular->x, + message.angular->y, + message.angular->z + ); + + size_t len = protobuf_c_message_get_packed_size((const ProtobufCMessage *) &message); + buffer=malloc(len); + size_t packed_len = protobuf_c_message_pack((const ProtobufCMessage *)&message, buffer); + + // set body data + memcpy(RACS2_UserMsgPkt.body_data, buffer, len); + // set body data length + RACS2_UserMsgPkt.body_data_length = len; + + // send data + CFE_SB_TimeStampMsg((CFE_SB_Msg_t *) &RACS2_UserMsgPkt); + status = CFE_SB_SendMsg((CFE_SB_Msg_t *) &RACS2_UserMsgPkt); + // OS_printf("RUN_APP: Sent message, MID = [0x%x], sample_command_count = %d\n", + // CFE_SB_GetMsgId((CFE_SB_MsgPtr_t) &RACS2_UserMsgPkt), + // RACS2_UserMsgPkt.sample_command_count + // ); + if (status != CFE_SUCCESS) { + OS_printf("RUN_APP: Error: sending is failed. status = 0x%x\n", status); + } + + free(buffer); + + count++; + } + + CFE_ES_ExitApp(RunStatus); + +} /* End of RUN_APP_Main() */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* */ +/* SAMPLE_TAKLKER_Init() -- initialization */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +void SAMPLE_TAKLKER_Init(void) +{ + /* + ** Register the app with Executive services + */ + CFE_ES_RegisterApp() ; + + /* + ** Register the events + */ + CFE_EVS_Register(SAMPLE_EventFilters, + sizeof(SAMPLE_EventFilters)/sizeof(CFE_EVS_BinFilter_t), + CFE_EVS_EventFilter_BINARY); + + RUN_APP_ResetCounters(); + + CFE_SB_InitMsg(&RUN_APP_HkTelemetryPkt, + RUN_APP_HK_TLM_MID, + SAMPLE_APP_HK_TLM_LNGTH, true); + + CFE_SB_InitMsg(&RACS2_UserMsgPkt, RACS2_BRIDGE_MID, RACS2_USER_MSG_LNGTH, false); + + CFE_EVS_SendEvent (SAMPLE_STARTUP_INF_EID, CFE_EVS_EventType_INFORMATION, + "RUN_APP App Initialized. Version %d.%d.%d.%d", + SAMPLE_APP_MAJOR_VERSION, + SAMPLE_APP_MINOR_VERSION, + SAMPLE_APP_REVISION, + SAMPLE_APP_MISSION_REV); + +} /* End of SAMPLE_TAKLKER_Init() */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +/* Name: RUN_APP_ProcessCommandPacket */ +/* */ +/* Purpose: */ +/* This routine will process any packet that is received on the RUN_APP */ +/* command pipe. */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +void RUN_APP_ProcessCommandPacket(void) +{ + CFE_SB_MsgId_t MsgId; + + MsgId = CFE_SB_GetMsgId(RUN_APP_MsgPtr); + + switch (MsgId) + { + case RUN_APP_CMD_MID: + RUN_APP_ProcessGroundCommand(); + break; + + case RUN_APP_SEND_HK_MID: + RUN_APP_ReportHousekeeping(); + break; + + default: + RUN_APP_HkTelemetryPkt.sample_command_error_count++; + CFE_EVS_SendEvent(SAMPLE_COMMAND_ERR_EID,CFE_EVS_EventType_ERROR, + "RUN_APP: invalid command packet,MID = 0x%x", MsgId); + break; + } + + return; + +} /* End RUN_APP_ProcessCommandPacket */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +/* */ +/* RUN_APP_ProcessGroundCommand() -- RUN_APP ground commands */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ + +void RUN_APP_ProcessGroundCommand(void) +{ + uint16 CommandCode; + + CommandCode = CFE_SB_GetCmdCode(RUN_APP_MsgPtr); + + /* Process "known" RUN_APP app ground commands */ + switch (CommandCode) + { + case SAMPLE_APP_NOOP_CC: + RUN_APP_HkTelemetryPkt.sample_command_count++; + CFE_EVS_SendEvent(SAMPLE_COMMANDNOP_INF_EID, + CFE_EVS_EventType_INFORMATION, + "RUN_APP: NOOP command"); + break; + + case SAMPLE_APP_RESET_COUNTERS_CC: + RUN_APP_ResetCounters(); + break; + + /* default case already found during FC vs length test */ + default: + break; + } + return; + +} /* End of RUN_APP_ProcessGroundCommand() */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +/* Name: RUN_APP_ReportHousekeeping */ +/* */ +/* Purpose: */ +/* This function is triggered in response to a task telemetry request */ +/* from the housekeeping task. This function will gather the Apps */ +/* telemetry, packetize it and send it to the housekeeping task via */ +/* the software bus */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +void RUN_APP_ReportHousekeeping(void) +{ + CFE_SB_TimeStampMsg((CFE_SB_Msg_t *) &RUN_APP_HkTelemetryPkt); + CFE_SB_SendMsg((CFE_SB_Msg_t *) &RUN_APP_HkTelemetryPkt); + return; + +} /* End of RUN_APP_ReportHousekeeping() */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +/* Name: RUN_APP_ResetCounters */ +/* */ +/* Purpose: */ +/* This function resets all the global counter variables that are */ +/* part of the task telemetry. */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +void RUN_APP_ResetCounters(void) +{ + /* Status of commands processed by the RUN_APP App */ + RUN_APP_HkTelemetryPkt.sample_command_count = 0; + RUN_APP_HkTelemetryPkt.sample_command_error_count = 0; + + CFE_EVS_SendEvent(SAMPLE_COMMANDRST_INF_EID, CFE_EVS_EventType_INFORMATION, + "RUN_APP: RESET command"); + return; + +} /* End of RUN_APP_ResetCounters() */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +/* */ +/* RUN_APP_VerifyCmdLength() -- Verify command packet length */ +/* */ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/ +bool RUN_APP_VerifyCmdLength(CFE_SB_MsgPtr_t msg, uint16 ExpectedLength) +{ + bool result = true; + + uint16 ActualLength = CFE_SB_GetTotalMsgLength(msg); + + /* + ** Verify the command packet length. + */ + if (ExpectedLength != ActualLength) + { + CFE_SB_MsgId_t MessageID = CFE_SB_GetMsgId(msg); + uint16 CommandCode = CFE_SB_GetCmdCode(msg); + + CFE_EVS_SendEvent(SAMPLE_LEN_ERR_EID, CFE_EVS_EventType_ERROR, + "Invalid msg length: ID = 0x%X, CC = %d, Len = %d, Expected = %d", + MessageID, CommandCode, ActualLength, ExpectedLength); + result = false; + RUN_APP_HkTelemetryPkt.sample_command_error_count++; + } + + return(result); + +} /* End of RUN_APP_VerifyCmdLength() */ + diff --git a/mars_rover/cFS/apps/run_app/fsw/src/run_app.h b/mars_rover/cFS/apps/run_app/fsw/src/run_app.h new file mode 100644 index 0000000..481095d --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/run_app.h @@ -0,0 +1,41 @@ +#ifndef _run_app_h_ +#define _run_app_h_ + +/* +** Required header files. +*/ +#include "cfe.h" +#include "cfe_error.h" +#include "cfe_evs.h" +#include "cfe_sb.h" +#include "cfe_es.h" + +#include +#include +#include + +/***********************************************************************/ + +#define SAMPLE_PIPE_DEPTH 32 + +/************************************************************************ +** Type Definitions +*************************************************************************/ + +/****************************************************************************/ +/* +** Local function prototypes. +** +** Note: Except for the entry point (RUN_APP_Main), these +** functions are not called from any other source module. +*/ +void RUN_APP_Main(void); +void SAMPLE_TAKLKER_Init(void); +void RUN_APP_ProcessCommandPacket(void); +void RUN_APP_ProcessGroundCommand(void); +void RUN_APP_ReportHousekeeping(void); +void RUN_APP_ResetCounters(void); + +bool RUN_APP_VerifyCmdLength(CFE_SB_MsgPtr_t msg, uint16 ExpectedLength); + +#endif /* _run_app_h_ */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/run_app_events.h b/mars_rover/cFS/apps/run_app/fsw/src/run_app_events.h new file mode 100644 index 0000000..5e324d1 --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/run_app_events.h @@ -0,0 +1,13 @@ +#ifndef _run_app_events_h_ +#define _run_app_events_h_ + + +#define SAMPLE_RESERVED_EID 20 +#define SAMPLE_STARTUP_INF_EID 21 +#define SAMPLE_COMMAND_ERR_EID 22 +#define SAMPLE_COMMANDNOP_INF_EID 23 +#define SAMPLE_COMMANDRST_INF_EID 24 +#define SAMPLE_INVALID_MSGID_ERR_EID 25 +#define SAMPLE_LEN_ERR_EID 26 + +#endif /* _run_app_events_h_ */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/run_app_msg.h b/mars_rover/cFS/apps/run_app/fsw/src/run_app_msg.h new file mode 100644 index 0000000..7e82b18 --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/run_app_msg.h @@ -0,0 +1,36 @@ +#ifndef _run_app_msg_h_ +#define _run_app_msg_h_ + +/* +** SAMPLE App command codes +*/ +#define SAMPLE_APP_NOOP_CC 0 +#define SAMPLE_APP_RESET_COUNTERS_CC 1 + +/*************************************************************************/ +/* +** Type definition (generic "no arguments" command) +*/ +typedef struct +{ + uint8 CmdHeader[CFE_SB_CMD_HDR_SIZE]; + +} SAMPLE_NoArgsCmd_t; + +/*************************************************************************/ +/* +** Type definition (SAMPLE App housekeeping) +*/ +typedef struct +{ + uint8 TlmHeader[CFE_SB_TLM_HDR_SIZE]; + uint8 sample_command_error_count; + uint8 sample_command_count; + uint8 spare[2]; + +} OS_PACK sample_hk_tlm_t ; + +#define SAMPLE_APP_HK_TLM_LNGTH sizeof ( sample_hk_tlm_t ) +#define RUN_APP_LISTENER_LNGTH sizeof ( sample_hk_tlm_t ) + +#endif /* _run_app_msg_h_ */ diff --git a/mars_rover/cFS/apps/run_app/fsw/src/run_app_version.h b/mars_rover/cFS/apps/run_app/fsw/src/run_app_version.h new file mode 100644 index 0000000..f6ea9ea --- /dev/null +++ b/mars_rover/cFS/apps/run_app/fsw/src/run_app_version.h @@ -0,0 +1,9 @@ +#ifndef _run_app_version_h_ +#define _run_app_version_h_ + +#define SAMPLE_APP_MAJOR_VERSION 1 +#define SAMPLE_APP_MINOR_VERSION 1 +#define SAMPLE_APP_REVISION 0 +#define SAMPLE_APP_MISSION_REV 0 + +#endif /* _run_app_version_h_ */ diff --git a/mars_rover/cFS/sample_defs/cpu1_cfe_es_startup.scr b/mars_rover/cFS/sample_defs/cpu1_cfe_es_startup.scr new file mode 100644 index 0000000..d53441a --- /dev/null +++ b/mars_rover/cFS/sample_defs/cpu1_cfe_es_startup.scr @@ -0,0 +1,34 @@ +CFE_APP, /cf/racs2_bridge_client.so, RACS2_BRIDGE_CLIENT_Main, RACS2_BRIDGE_CLIENT, 55, 16384, 0x0, 0; +CFE_APP, /cf/run_app.so, RUN_APP_Main, RUN_APP, 57, 16384, 0x0, 0; +! +! CFE_LIB, /cf/sample_lib.so, SAMPLE_LibInit, SAMPLE_LIB, 0, 0, 0x0, 0; +! CFE_APP, /cf/racs2_bridge_client.so, RACS2_BRIDGE_CLIENT_Main, RACS2_BRIDGE_CLIENT, 55, 16384, 0x0, 0; +! CFE_APP, /cf/sample_listener.so, SAMPLE_LISTENER_Main, SAMPLE_LISTENER, 56, 16384, 0x0, 0; +! CFE_APP, /cf/ci_lab.so, CI_Lab_AppMain, CI_LAB_APP, 60, 16384, 0x0, 0; +! CFE_APP, /cf/to_lab.so, TO_Lab_AppMain, TO_LAB_APP, 70, 16384, 0x0, 0; +! CFE_APP, /cf/sch_lab.so, SCH_Lab_AppMain, SCH_LAB_APP, 80, 16384, 0x0, 0; +! +! Startup script fields: +! 1. Object Type -- CFE_APP for an Application, or CFE_LIB for a library. +! 2. Path/Filename -- This is a cFE Virtual filename, not a vxWorks device/pathname +! 3. Entry Point -- This is the "main" function for Apps. +! 4. CFE Name -- The cFE name for the the APP or Library +! 5. Priority -- This is the Priority of the App, not used for Library +! 6. Stack Size -- This is the Stack size for the App, not used for the Library +! 7. Load Address -- This is the Optional Load Address for the App or Library. Currently not implemented +! so keep it at 0x0. +! 8. Exception Action -- This is the Action the cFE should take if the App has an exception. +! 0 = Just restart the Application +! Non-Zero = Do a cFE Processor Reset +! +! Other Notes: +! 1. The software will not try to parse anything after the first '!' character it sees. That +! is the End of File marker. +! 2. Common Application file extensions: +! Linux = .so ( ci.so ) +! OS X = .bundle ( ci.bundle ) +! Cygwin = .dll ( ci.dll ) +! vxWorks = .o ( ci.o ) +! RTEMS with S-record Loader = .s3r ( ci.s3r ) +! RTEMS with CEXP Loader = .o ( ci.o ) + diff --git a/mars_rover/cFS/sample_defs/racs2_bridge_config.txt b/mars_rover/cFS/sample_defs/racs2_bridge_config.txt new file mode 100644 index 0000000..9502c84 --- /dev/null +++ b/mars_rover/cFS/sample_defs/racs2_bridge_config.txt @@ -0,0 +1,2 @@ +wss_uri=localhost +wss_port=8765 \ No newline at end of file diff --git a/mars_rover/cFS/sample_defs/targets.cmake b/mars_rover/cFS/sample_defs/targets.cmake new file mode 100644 index 0000000..12e23c7 --- /dev/null +++ b/mars_rover/cFS/sample_defs/targets.cmake @@ -0,0 +1,100 @@ +###################################################################### +# +# Master config file for cFS target boards +# +# This file indicates the architecture and configuration of the +# target boards that will run core flight software. +# +# The following variables are defined per board, where is the +# CPU number starting with 1: +# +# TGT_NAME : the user-friendly name of the cpu. Should be simple +# word with no punctuation. This MUST be specified. +# TGT_APPLIST : list of applications to build and install on the CPU. +# These are built as dynamically-loaded applications and installed +# as files in the non-volatile storage of the target, and loaded +# at runtime via the startup script or commands. +# TGT_STATIC_APPLIST : list of applications to build and statically +# link with the CFE executable. This is similar to the "APPLIST" +# except the application is built with STATIC linkage, and it is +# included directly when linking the CFE core executable itself. +# No separate application file is generated for these apps. +# TGT_STATIC_SYMLIST : list of symbols to include in the OSAL static +# symbol lookup table. Each entry is a comma-separated pair containing +# the symbol name and virtual module/app name, such as +# My_C_Function_Name,MY_APP +# The first item must be a publicly-exposed C symbol name available to +# the linker at static link time, generally the entry point/main function +# of the a module or library (see STATIC_APPLIST). The second item is the +# module name that should match the name used in the CFE startup script +# (4th parameter). +# IMPORTANT: For this to work, the OS_STATIC_LOADER configuration option +# must be specified in the osconfig.h for that CPU. +# TGT_PSP_MODULELIST : additional PSP "modules" to link into the +# CFE executable for this target. These can be device drivers or +# other bits of modular PSP functionality that provide I/O or other +# low level functions. +# TGT_FILELIST : list of extra files to copy onto the target. No +# modifications of the file will be made. In order to differentiate +# between different versions of files with the same name, priority +# will be given to a file named _ to be installed +# as simply on that cpu (prefix will be removed). These +# files are intended to be copied to the non-volatile storage on the +# target for use during runtime. +# TGT_EMBED_FILELIST : list of extra files which are to be converted +# into data arrays and linked with/embedded into the CFE executable, +# so the content of the files can be available at runtime on systems +# that do not have run time non-volatile storage. The format of each +# list entry is a comma-separated pair of variable and file name: +# VARIABLE_NAME,FILE_NAME +# The binary contents of the file will subsequently be available as: +# extern const char VARIABLE_NAME_DATA[] and +# extern const unsigned long VARIABLE_NAME_SIZE +# The same prefix-based filename mapping as used on FILELIST is also +# employed here, allowing CPU-specific data files to be used. +# TGT_SYSTEM : the toolchain to use for building all code. This +# will map to a CMake toolchain file called "toolchain-" +# If not specified then it will default to "cpu" so that +# each CPU will have a dedicated toolchain file and no objects +# will be shared across CPUs. +# Otherwise any code built using the same toolchain may be +# copied to multiple CPUs for more efficient builds. +# TGT_PLATFORM : configuration for the CFE core to use for this +# cpu. This determines the cfe_platform_cfg.h to use during the +# build. Multiple files/components may be concatenated together +# allowing the config to be generated in a modular fashion. If +# not specified then it will be assumed as "default ". +# + +# The MISSION_NAME will be compiled into the target build data structure +# as well as being passed to "git describe" to filter the tags when building +# the version string. +SET(MISSION_NAME "SampleMission") + +# SPACECRAFT_ID gets compiled into the build data structure and the PSP may use it. +# should be an integer. +SET(SPACECRAFT_ID 42) + +# UI_INSTALL_SUBDIR indicates where the UI data files (included in some apps) should +# be copied during the install process. +SET(UI_INSTALL_SUBDIR "host/ui") + +# FT_INSTALL_SUBDIR indicates where the black box test data files (lua scripts) should +# be copied during the install process. +SET(FT_INSTALL_SUBDIR "host/functional-test") + +# Each target board can have its own HW arch selection and set of included apps +SET(TGT1_NAME cpu1) +SET(TGT1_APPLIST sample_app racs2_bridge_client run_app sample_lib ci_lab to_lab sch_lab) +SET(TGT1_FILELIST cfe_es_startup.scr racs2_bridge_config.txt) + +# CPU2/3 are duplicates of CPU1. These are not built by default anymore but are +# commented out to serve as an example of how one would configure multiple cpus. +#SET(TGT2_NAME cpu2) +#SET(TGT2_APPLIST sample_app ci_lab to_lab sch_lab) +#SET(TGT2_FILELIST cfe_es_startup.scr) + +#SET(TGT3_NAME cpu3) +#SET(TGT3_APPLIST sample_app ci_lab to_lab sch_lab) +#SET(TGT3_FILELIST cfe_es_startup.scr) + diff --git a/mars_rover/nodes/RACS2Bridge_geometry_msgs_pb2.py b/mars_rover/nodes/RACS2Bridge_geometry_msgs_pb2.py new file mode 100644 index 0000000..2ffdfea --- /dev/null +++ b/mars_rover/nodes/RACS2Bridge_geometry_msgs_pb2.py @@ -0,0 +1,374 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: RACS2Bridge_geometry_msgs.proto + +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='RACS2Bridge_geometry_msgs.proto', + package='', + syntax='proto2', + serialized_options=None, + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x1fRACS2Bridge_geometry_msgs.proto\"D\n!RACS2Bridge_geometry_msgs_Vector3\x12\t\n\x01x\x18\x01 \x02(\x01\x12\t\n\x01y\x18\x02 \x02(\x01\x12\t\n\x01z\x18\x03 \x02(\x01\"\x8a\x01\n\x1fRACS2Bridge_geometry_msgs_Twist\x12\x32\n\x06linear\x18\x01 \x02(\x0b\x32\".RACS2Bridge_geometry_msgs_Vector3\x12\x33\n\x07\x61ngular\x18\x02 \x02(\x0b\x32\".RACS2Bridge_geometry_msgs_Vector3\"\xe9\x06\n\x19RACS2Bridge_geometry_msgs\x12&\n\x1a\x61\x63\x63\x65l_with_covariance_data\x18\x01 \x03(\x02\x42\x02\x10\x01\x12.\n\"accel_with_covariance_stamped_data\x18\x02 \x03(\x02\x42\x02\x10\x01\x12\x1e\n\x12point_stamped_data\x18\x03 \x03(\x02\x42\x02\x10\x01\x12 \n\x14inertia_stamped_data\x18\x04 \x03(\x02\x42\x02\x10\x01\x12#\n\x17quaternion_stamped_data\x18\x05 \x03(\x02\x42\x02\x10\x01\x12\"\n\x16transform_stamped_data\x18\x06 \x03(\x02\x42\x02\x10\x01\x12\x18\n\x0cinertia_data\x18\x07 \x03(\x02\x42\x02\x10\x01\x12%\n\x19pose_with_covariance_data\x18\x08 \x03(\x02\x42\x02\x10\x01\x12)\n\x1dtwist_covariance_stamped_data\x18\t \x03(\x02\x42\x02\x10\x01\x12\x17\n\x0bwrench_data\x18\n \x03(\x02\x42\x02\x10\x01\x12\x16\n\naccel_data\x18\x0b \x03(\x02\x42\x02\x10\x01\x12-\n!pose_with_covariance_stamped_data\x18\x0c \x03(\x02\x42\x02\x10\x01\x12\x1f\n\x13\x61\x63\x63\x65le_stamped_data\x18\r \x03(\x02\x42\x02\x10\x01\x12\x1a\n\x0etransform_data\x18\x0e \x03(\x02\x42\x02\x10\x01\x12\x16\n\npoint_data\x18\x0f \x03(\x02\x42\x02\x10\x01\x12\x1f\n\x13polygon_stamped_dta\x18\x10 \x03(\x02\x42\x02\x10\x01\x12\x1b\n\x0fpose_array_data\x18\x11 \x03(\x02\x42\x02\x10\x01\x12 \n\x14vector3_stamped_data\x18\x12 \x03(\x02\x42\x02\x10\x01\x12\x1d\n\x11pose_stamped_data\x18\x13 \x03(\x02\x42\x02\x10\x01\x12\x18\n\x0cpolygon_data\x18\x14 \x03(\x02\x42\x02\x10\x01\x12\x1c\n\x10queaternion_data\x18\x15 \x03(\x02\x42\x02\x10\x01\x12\x18\n\x0cpoint32_data\x18\x16 \x03(\x02\x42\x02\x10\x01\x12&\n\x1atwist_with_covariance_data\x18\x17 \x03(\x02\x42\x02\x10\x01\x12\x15\n\tpose_data\x18\x18 \x03(\x02\x42\x02\x10\x01\x12\x1e\n\x12twist_stamped_data\x18\x19 \x03(\x02\x42\x02\x10\x01\x12\x18\n\x0cpose_2d_data\x18\x1a \x03(\x02\x42\x02\x10\x01' +) + + + + +_RACS2BRIDGE_GEOMETRY_MSGS_VECTOR3 = _descriptor.Descriptor( + name='RACS2Bridge_geometry_msgs_Vector3', + full_name='RACS2Bridge_geometry_msgs_Vector3', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='x', full_name='RACS2Bridge_geometry_msgs_Vector3.x', index=0, + number=1, type=1, cpp_type=5, label=2, + 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, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='y', full_name='RACS2Bridge_geometry_msgs_Vector3.y', index=1, + number=2, type=1, cpp_type=5, label=2, + 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, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='z', full_name='RACS2Bridge_geometry_msgs_Vector3.z', index=2, + number=3, type=1, cpp_type=5, label=2, + 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, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=35, + serialized_end=103, +) + + +_RACS2BRIDGE_GEOMETRY_MSGS_TWIST = _descriptor.Descriptor( + name='RACS2Bridge_geometry_msgs_Twist', + full_name='RACS2Bridge_geometry_msgs_Twist', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='linear', full_name='RACS2Bridge_geometry_msgs_Twist.linear', index=0, + number=1, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='angular', full_name='RACS2Bridge_geometry_msgs_Twist.angular', index=1, + number=2, type=11, cpp_type=10, label=2, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=106, + serialized_end=244, +) + + +_RACS2BRIDGE_GEOMETRY_MSGS = _descriptor.Descriptor( + name='RACS2Bridge_geometry_msgs', + full_name='RACS2Bridge_geometry_msgs', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='accel_with_covariance_data', full_name='RACS2Bridge_geometry_msgs.accel_with_covariance_data', index=0, + number=1, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='accel_with_covariance_stamped_data', full_name='RACS2Bridge_geometry_msgs.accel_with_covariance_stamped_data', index=1, + number=2, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='point_stamped_data', full_name='RACS2Bridge_geometry_msgs.point_stamped_data', index=2, + number=3, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='inertia_stamped_data', full_name='RACS2Bridge_geometry_msgs.inertia_stamped_data', index=3, + number=4, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='quaternion_stamped_data', full_name='RACS2Bridge_geometry_msgs.quaternion_stamped_data', index=4, + number=5, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='transform_stamped_data', full_name='RACS2Bridge_geometry_msgs.transform_stamped_data', index=5, + number=6, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='inertia_data', full_name='RACS2Bridge_geometry_msgs.inertia_data', index=6, + number=7, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='pose_with_covariance_data', full_name='RACS2Bridge_geometry_msgs.pose_with_covariance_data', index=7, + number=8, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='twist_covariance_stamped_data', full_name='RACS2Bridge_geometry_msgs.twist_covariance_stamped_data', index=8, + number=9, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='wrench_data', full_name='RACS2Bridge_geometry_msgs.wrench_data', index=9, + number=10, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='accel_data', full_name='RACS2Bridge_geometry_msgs.accel_data', index=10, + number=11, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='pose_with_covariance_stamped_data', full_name='RACS2Bridge_geometry_msgs.pose_with_covariance_stamped_data', index=11, + number=12, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='accele_stamped_data', full_name='RACS2Bridge_geometry_msgs.accele_stamped_data', index=12, + number=13, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='transform_data', full_name='RACS2Bridge_geometry_msgs.transform_data', index=13, + number=14, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='point_data', full_name='RACS2Bridge_geometry_msgs.point_data', index=14, + number=15, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='polygon_stamped_dta', full_name='RACS2Bridge_geometry_msgs.polygon_stamped_dta', index=15, + number=16, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='pose_array_data', full_name='RACS2Bridge_geometry_msgs.pose_array_data', index=16, + number=17, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='vector3_stamped_data', full_name='RACS2Bridge_geometry_msgs.vector3_stamped_data', index=17, + number=18, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='pose_stamped_data', full_name='RACS2Bridge_geometry_msgs.pose_stamped_data', index=18, + number=19, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='polygon_data', full_name='RACS2Bridge_geometry_msgs.polygon_data', index=19, + number=20, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='queaternion_data', full_name='RACS2Bridge_geometry_msgs.queaternion_data', index=20, + number=21, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='point32_data', full_name='RACS2Bridge_geometry_msgs.point32_data', index=21, + number=22, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='twist_with_covariance_data', full_name='RACS2Bridge_geometry_msgs.twist_with_covariance_data', index=22, + number=23, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='pose_data', full_name='RACS2Bridge_geometry_msgs.pose_data', index=23, + number=24, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='twist_stamped_data', full_name='RACS2Bridge_geometry_msgs.twist_stamped_data', index=24, + number=25, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='pose_2d_data', full_name='RACS2Bridge_geometry_msgs.pose_2d_data', index=25, + number=26, type=2, cpp_type=6, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\020\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto2', + extension_ranges=[], + oneofs=[ + ], + serialized_start=247, + serialized_end=1120, +) + +_RACS2BRIDGE_GEOMETRY_MSGS_TWIST.fields_by_name['linear'].message_type = _RACS2BRIDGE_GEOMETRY_MSGS_VECTOR3 +_RACS2BRIDGE_GEOMETRY_MSGS_TWIST.fields_by_name['angular'].message_type = _RACS2BRIDGE_GEOMETRY_MSGS_VECTOR3 +DESCRIPTOR.message_types_by_name['RACS2Bridge_geometry_msgs_Vector3'] = _RACS2BRIDGE_GEOMETRY_MSGS_VECTOR3 +DESCRIPTOR.message_types_by_name['RACS2Bridge_geometry_msgs_Twist'] = _RACS2BRIDGE_GEOMETRY_MSGS_TWIST +DESCRIPTOR.message_types_by_name['RACS2Bridge_geometry_msgs'] = _RACS2BRIDGE_GEOMETRY_MSGS +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +RACS2Bridge_geometry_msgs_Vector3 = _reflection.GeneratedProtocolMessageType('RACS2Bridge_geometry_msgs_Vector3', (_message.Message,), { + 'DESCRIPTOR' : _RACS2BRIDGE_GEOMETRY_MSGS_VECTOR3, + '__module__' : 'RACS2Bridge_geometry_msgs_pb2' + # @@protoc_insertion_point(class_scope:RACS2Bridge_geometry_msgs_Vector3) + }) +_sym_db.RegisterMessage(RACS2Bridge_geometry_msgs_Vector3) + +RACS2Bridge_geometry_msgs_Twist = _reflection.GeneratedProtocolMessageType('RACS2Bridge_geometry_msgs_Twist', (_message.Message,), { + 'DESCRIPTOR' : _RACS2BRIDGE_GEOMETRY_MSGS_TWIST, + '__module__' : 'RACS2Bridge_geometry_msgs_pb2' + # @@protoc_insertion_point(class_scope:RACS2Bridge_geometry_msgs_Twist) + }) +_sym_db.RegisterMessage(RACS2Bridge_geometry_msgs_Twist) + +RACS2Bridge_geometry_msgs = _reflection.GeneratedProtocolMessageType('RACS2Bridge_geometry_msgs', (_message.Message,), { + 'DESCRIPTOR' : _RACS2BRIDGE_GEOMETRY_MSGS, + '__module__' : 'RACS2Bridge_geometry_msgs_pb2' + # @@protoc_insertion_point(class_scope:RACS2Bridge_geometry_msgs) + }) +_sym_db.RegisterMessage(RACS2Bridge_geometry_msgs) + + +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['accel_with_covariance_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['accel_with_covariance_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['point_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['inertia_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['quaternion_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['transform_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['inertia_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['pose_with_covariance_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['twist_covariance_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['wrench_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['accel_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['pose_with_covariance_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['accele_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['transform_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['point_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['polygon_stamped_dta']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['pose_array_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['vector3_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['pose_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['polygon_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['queaternion_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['point32_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['twist_with_covariance_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['pose_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['twist_stamped_data']._options = None +_RACS2BRIDGE_GEOMETRY_MSGS.fields_by_name['pose_2d_data']._options = None +# @@protoc_insertion_point(module_scope) diff --git a/mars_rover/nodes/move_wheel b/mars_rover/nodes/move_wheel index c016ad0..8bf4b11 100644 --- a/mars_rover/nodes/move_wheel +++ b/mars_rover/nodes/move_wheel @@ -9,6 +9,9 @@ from std_msgs.msg import String, Float64MultiArray from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint from geometry_msgs.msg import Twist import math +from racs2_msg.msg import RACS2UserMsg +from RACS2Bridge_geometry_msgs_pb2 import RACS2Bridge_geometry_msgs_Twist + class MoveWheel(Node): @@ -21,19 +24,33 @@ class MoveWheel(Node): self.timer = self.create_timer(timer_period, self.timer_callback) - self.vel_sub = self.create_subscription(Twist, '/cmd_vel', self.vel_callback, 10) + # self.vel_sub = self.create_subscription(Twist, '/cmd_vel', self.vel_callback, 10) + self.vel_sub = self.create_subscription(RACS2UserMsg, '/cmd_vel', self.vel_callback, 10) self.curr_vel = Twist() self.last_vel = Twist() self.should_steer = False def vel_callback(self, msg): + self.get_logger().info('Subscribing: [/cmd_vel]') + message = RACS2Bridge_geometry_msgs_Twist() + message.ParseFromString(b''.join(msg.body_data)) + self.get_logger().info(f"message: {message}") + twist_msg = Twist() + twist_msg.linear.x = message.linear.x + twist_msg.linear.y = message.linear.y + twist_msg.linear.z = message.linear.z + twist_msg.angular.x = message.angular.x + twist_msg.angular.y = message.angular.y + twist_msg.angular.z = message.angular.z if abs(self.last_vel.angular.z - self.curr_vel.angular.z) > 0.01 and self.should_steer is False: self.last_vel = Twist() self.last_vel.linear.x = self.curr_vel.linear.x self.last_vel.angular.z = self.curr_vel.angular.z self.should_steer = True - self.curr_vel = msg + # self.curr_vel = msg + self.curr_vel = twist_msg + self.get_logger().info(f"self.curr_vel: {self.curr_vel}") def set_wheel_common_speed(self, vel):