forked from lukicdarkoo/pico-micro-ros
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
micro-ROS rolling Library auto-update 11-02-2022 06:07
- Loading branch information
Showing
20 changed files
with
1,603 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
libmicroros/include/rosidl_runtime_c/rosidl_runtime_c/action_type_support_struct.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2018 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSIDL_RUNTIME_C__ACTION_TYPE_SUPPORT_STRUCT_H_ | ||
#define ROSIDL_RUNTIME_C__ACTION_TYPE_SUPPORT_STRUCT_H_ | ||
|
||
#include "rosidl_runtime_c/message_type_support_struct.h" | ||
#include "rosidl_runtime_c/service_type_support_struct.h" | ||
#include "rosidl_runtime_c/visibility_control.h" | ||
#include "rosidl_typesupport_interface/macros.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
typedef struct rosidl_action_type_support_t rosidl_action_type_support_t; | ||
|
||
/// Contains rosidl action type support data. | ||
/* | ||
* Actions are built based on services(goal, result and cancel) and message (feedback and status). | ||
*/ | ||
struct rosidl_action_type_support_t | ||
{ | ||
const rosidl_service_type_support_t * goal_service_type_support; | ||
const rosidl_service_type_support_t * result_service_type_support; | ||
const rosidl_service_type_support_t * cancel_service_type_support; | ||
const rosidl_message_type_support_t * feedback_message_type_support; | ||
const rosidl_message_type_support_t * status_message_type_support; | ||
}; | ||
|
||
/// Get the action type support given a provided action and package. | ||
/* | ||
* \param PkgName name of the package that contains the action | ||
* \param Name action name | ||
* \return a rosidl_action_type_support_t struct if found, otherwise NULL. | ||
*/ | ||
#define ROSIDL_GET_ACTION_TYPE_SUPPORT(PkgName, Name) \ | ||
ROSIDL_TYPESUPPORT_INTERFACE__ACTION_SYMBOL_NAME( \ | ||
rosidl_typesupport_c, PkgName, action, Name)() | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // ROSIDL_RUNTIME_C__ACTION_TYPE_SUPPORT_STRUCT_H_ |
35 changes: 35 additions & 0 deletions
35
libmicroros/include/rosidl_runtime_c/rosidl_runtime_c/message_initialization.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2017 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSIDL_RUNTIME_C__MESSAGE_INITIALIZATION_H_ | ||
#define ROSIDL_RUNTIME_C__MESSAGE_INITIALIZATION_H_ | ||
|
||
enum rosidl_runtime_c__message_initialization | ||
{ | ||
// Initialize all fields of the message, either with the default value | ||
// (if the field has one), or with an empty value (generally 0 or an | ||
// empty string). | ||
ROSIDL_RUNTIME_C_MSG_INIT_ALL, | ||
// Skip initialization of all fields of the message. It is up to the user to | ||
// ensure that all fields are initialized before use. | ||
ROSIDL_RUNTIME_C_MSG_INIT_SKIP, | ||
// Initialize all fields of the message to an empty value (generally 0 or an | ||
// empty string). | ||
ROSIDL_RUNTIME_C_MSG_INIT_ZERO, | ||
// Initialize all fields of the message that have defaults; all other fields | ||
// are left untouched. | ||
ROSIDL_RUNTIME_C_MSG_INIT_DEFAULTS_ONLY, | ||
}; | ||
|
||
#endif // ROSIDL_RUNTIME_C__MESSAGE_INITIALIZATION_H_ |
84 changes: 84 additions & 0 deletions
84
libmicroros/include/rosidl_runtime_c/rosidl_runtime_c/message_type_support_struct.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright 2015-2016 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSIDL_RUNTIME_C__MESSAGE_TYPE_SUPPORT_STRUCT_H_ | ||
#define ROSIDL_RUNTIME_C__MESSAGE_TYPE_SUPPORT_STRUCT_H_ | ||
|
||
#include "rosidl_runtime_c/visibility_control.h" | ||
#include "rosidl_typesupport_interface/macros.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
typedef struct rosidl_message_type_support_t rosidl_message_type_support_t; | ||
|
||
typedef const rosidl_message_type_support_t * (* rosidl_message_typesupport_handle_function)( | ||
const rosidl_message_type_support_t *, const char *); | ||
|
||
/// Contains rosidl message type support data | ||
struct rosidl_message_type_support_t | ||
{ | ||
/// String identifier for the type_support. | ||
const char * typesupport_identifier; | ||
/// Pointer to the message type support library | ||
const void * data; | ||
/// Pointer to the message type support handler function | ||
rosidl_message_typesupport_handle_function func; | ||
}; | ||
|
||
/// Get the message type support handle specific to this identifier. | ||
/** | ||
* The handle's message typesupport identifier function is returned or if the parameters are NULL | ||
* then an assert will happen. | ||
* | ||
* \param handle Handle to message type support | ||
* \param identifier The typesupport identifier to get the handle function for | ||
* \return The associated message typesupport handle function. | ||
*/ | ||
ROSIDL_GENERATOR_C_PUBLIC | ||
const rosidl_message_type_support_t * get_message_typesupport_handle( | ||
const rosidl_message_type_support_t * handle, const char * identifier); | ||
|
||
// Get the message type support handle function specific to this identifier. | ||
/** | ||
* If the identifier is the same as this handle's typesupport_identifier the handle is simply | ||
* returned or if the parameters are NULL then an assert will happen. | ||
* | ||
* \param handle Handle to message type support | ||
* \param identifier The typesupport identifier to get the handle function for | ||
* \return if the identifier match's the handle's identifier then the handle's function | ||
* is returned. | ||
*/ | ||
ROSIDL_GENERATOR_C_PUBLIC | ||
const rosidl_message_type_support_t * get_message_typesupport_handle_function( | ||
const rosidl_message_type_support_t * handle, const char * identifier); | ||
|
||
/// Get the message type support given a provided action and package. | ||
/* | ||
* \param PkgName Name of the package that contains the message | ||
* \param MsgSubfolder name of the subfolder (for example: msg) | ||
* \param MsgName message name | ||
* \return a rosidl_message_type_support_t struct if founded, otherwise NULL. | ||
*/ | ||
#define ROSIDL_GET_MSG_TYPE_SUPPORT(PkgName, MsgSubfolder, MsgName) \ | ||
ROSIDL_TYPESUPPORT_INTERFACE__MESSAGE_SYMBOL_NAME( \ | ||
rosidl_typesupport_c, PkgName, MsgSubfolder, MsgName)() | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // ROSIDL_RUNTIME_C__MESSAGE_TYPE_SUPPORT_STRUCT_H_ |
57 changes: 57 additions & 0 deletions
57
libmicroros/include/rosidl_runtime_c/rosidl_runtime_c/primitives_sequence.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Copyright 2015 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSIDL_RUNTIME_C__PRIMITIVES_SEQUENCE_H_ | ||
#define ROSIDL_RUNTIME_C__PRIMITIVES_SEQUENCE_H_ | ||
|
||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
#define ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(STRUCT_NAME, TYPE_NAME) \ | ||
typedef struct rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence \ | ||
{ \ | ||
TYPE_NAME * data; /*!< The pointer to an array of STRUCT_NAME */ \ | ||
size_t size; /*!< The number of valid items in data */ \ | ||
size_t capacity; /*!< The number of allocated items in data */ \ | ||
} rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence; | ||
|
||
// sequence types for all basic types | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(float, float) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(double, double) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(long_double, long double) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(char, signed char) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(wchar, uint16_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(boolean, bool) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(octet, uint8_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(uint8, uint8_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(int8, int8_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(uint16, uint16_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(int16, int16_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(uint32, uint32_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(int32, int32_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(uint64, uint64_t) | ||
ROSIDL_RUNTIME_C__PRIMITIVE_SEQUENCE(int64, int64_t) | ||
|
||
// emulate legacy API | ||
typedef rosidl_runtime_c__boolean__Sequence | ||
rosidl_runtime_c__bool__Sequence; | ||
typedef rosidl_runtime_c__octet__Sequence | ||
rosidl_runtime_c__byte__Sequence; | ||
typedef rosidl_runtime_c__float__Sequence | ||
rosidl_runtime_c__float32__Sequence; | ||
typedef rosidl_runtime_c__double__Sequence | ||
rosidl_runtime_c__float64__Sequence; | ||
|
||
#endif // ROSIDL_RUNTIME_C__PRIMITIVES_SEQUENCE_H_ |
Oops, something went wrong.