-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow transport to generate messages
Signed-off-by: Michael Carroll <[email protected]>
- Loading branch information
Showing
11 changed files
with
413 additions
and
3 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
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
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,23 @@ | ||
set(proto_files | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/discovery.proto | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/parameter.proto | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/parameter_declaration.proto | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/parameter_declarations.proto | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/parameter_error.proto | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/parameter_name.proto | ||
${PROJECT_SOURCE_DIR}/proto/gz/msgs/parameter_value.proto | ||
) | ||
|
||
gz_msgs_generate_messages( | ||
TARGET gz-transport13-msgs | ||
PROTO_PACKAGE "gz.msgs" | ||
MSGS_PATH ${PROJECT_SOURCE_DIR}/proto | ||
MSGS_PROTOS ${proto_files} | ||
DEPENDENCIES gz-msgs10::gz-msgs10-msgs | ||
) | ||
|
||
install( | ||
DIRECTORY gz | ||
DESTINATION share/protos | ||
COMPONENT proto | ||
FILES_MATCHING PATTERN "*.proto") |
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,181 @@ | ||
/* | ||
* Copyright (C) 2019 Open Source Robotics Foundation | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
syntax = "proto3"; | ||
package gz.msgs; | ||
option java_package = "com.gz.msgs"; | ||
option java_outer_classname = "DiscoveryProtos"; | ||
|
||
/// \ingroup gz.msgs | ||
/// \interface Discovery | ||
/// \brief Message that contains Discovery information. | ||
|
||
import "gz/msgs/header.proto"; | ||
|
||
message Discovery | ||
{ | ||
/// \brief Type of discovery message. | ||
enum Type | ||
{ | ||
/// \brief Type not initialized. | ||
UNINITIALIZED = 0; | ||
|
||
/// \brief Advertise message. | ||
ADVERTISE = 1; | ||
|
||
/// \brief Subscribe message. | ||
SUBSCRIBE = 2; | ||
|
||
/// \brief Unadvertise message. | ||
UNADVERTISE = 3; | ||
|
||
/// \brief Hearbeat message. | ||
HEARTBEAT = 4; | ||
|
||
/// \brief Bye message. | ||
BYE = 5; | ||
|
||
/// \brief New connection message. | ||
NEW_CONNECTION = 6; | ||
|
||
/// \brief End connection message. | ||
END_CONNECTION = 7; | ||
|
||
/// \brief Request the list of subscribers. | ||
SUBSCRIBERS_REQ = 8; | ||
|
||
/// \brief Reply to a SUBSCRIBERS_REQ. | ||
SUBSCRIBERS_REP = 9; | ||
} | ||
|
||
/// \brief Discovery flags. | ||
message Flags | ||
{ | ||
/// \brief Flag set when a discovery message is relayed. | ||
bool relay = 1; | ||
|
||
/// \brief Flag set when we want to avoid to relay a discovery message. | ||
/// This is used to avoid loops. | ||
bool no_relay = 2; | ||
} | ||
|
||
/// \brief Information about a subscriber. | ||
message Subscriber | ||
{ | ||
string topic = 1; | ||
} | ||
|
||
/// \brief Information about a publisher. | ||
message Publisher | ||
{ | ||
/// \brief Defines the different options for the scope of a topic/service. | ||
enum Scope | ||
{ | ||
/// \brief Topic/service only available to subscribers in the same | ||
/// process as the publisher. | ||
PROCESS = 0; | ||
|
||
/// \brief Topic/service only available to subscribers in the same | ||
/// machine as the publisher. | ||
HOST = 1; | ||
|
||
/// \brief Topic/service available to any subscriber. | ||
ALL = 2; | ||
} | ||
|
||
/// \brief Information about a message publisher. | ||
message MessagePublisher | ||
{ | ||
/// \brief ZeroMQ control address of the publisher. | ||
/// \todo(caguero) Is this the same as 'socket_id' in the | ||
/// ServicePublisher message? | ||
string ctrl = 1; | ||
|
||
/// \brief Message type advertised by this publisher. | ||
string msg_type = 2; | ||
|
||
/// \brief Whether the publication has been throttled. | ||
bool throttled = 3; | ||
|
||
/// \brief The maximum number of messages per second to be published. | ||
uint64 msgs_per_sec = 4; | ||
} | ||
|
||
/// \brief Information about service provider. | ||
message ServicePublisher | ||
{ | ||
/// \brief ZeroMQ socket ID used by this publisher. | ||
string socket_id = 1; | ||
|
||
/// \brief The name of the request's protobuf message advertised. | ||
string request_type = 2; | ||
|
||
/// \brief The name of the response's protobuf message advertised. | ||
string response_type = 3; | ||
} | ||
|
||
/// \brief Topic name. | ||
string topic = 1; | ||
|
||
/// \brief ZeroMQ address of the publisher. | ||
string address = 2; | ||
|
||
/// \brief Process UUID of the publisher. | ||
string process_uuid = 3; | ||
|
||
/// \brief Node UUID of the publisher. | ||
string node_uuid = 4; | ||
|
||
/// \brief The scope of this publisher. | ||
Scope scope = 5; | ||
|
||
/// \brief Information about a message or service publisher. | ||
oneof pub_type | ||
{ | ||
/// \brief Message publisher. | ||
MessagePublisher msg_pub = 6; | ||
|
||
/// \brief Service provider. | ||
ServicePublisher srv_pub = 7; | ||
} | ||
} | ||
|
||
/// \brief Optional header data. | ||
Header header = 1; | ||
|
||
/// \brief Version of the discovery protocol. | ||
uint32 version = 2; | ||
|
||
/// \brief Process UUID. | ||
string process_uuid = 3; | ||
|
||
/// \brief The type of this message. | ||
Type type = 4; | ||
|
||
/// \brief Optional flags. | ||
Flags flags = 5; | ||
|
||
/// \brief Optional subscriber or publisher information. | ||
oneof disc_contents | ||
{ | ||
/// \brief Subscriber information. | ||
Subscriber sub = 6; | ||
|
||
/// \brief Publisher information. | ||
Publisher pub = 7; | ||
} | ||
} |
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,36 @@ | ||
/* | ||
* Copyright (C) 2022 Open Source Robotics Foundation | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
syntax = "proto3"; | ||
package gz.msgs; | ||
option java_package = "com.gz.msgs"; | ||
option java_outer_classname = "ParameterProtos"; | ||
|
||
/// \ingroup gz.msgs | ||
/// \interface Parameter | ||
/// \brief Representation of a parameter, used to request to set a parameter. | ||
|
||
import "google/protobuf/any.proto"; | ||
|
||
message Parameter | ||
{ | ||
/// \brief Parameter name. | ||
string name = 1; | ||
|
||
/// \brief Serialized parameter value. | ||
google.protobuf.Any value = 2; | ||
}; |
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,34 @@ | ||
/* | ||
* Copyright (C) 2022 Open Source Robotics Foundation | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
syntax = "proto3"; | ||
package gz.msgs; | ||
option java_package = "com.gz.msgs"; | ||
option java_outer_classname = "ParameterDeclarationProtos"; | ||
|
||
/// \ingroup gz.msgs | ||
/// \interface ParameterDeclaration | ||
/// \brief Representation of a parameter declaration. | ||
|
||
message ParameterDeclaration | ||
{ | ||
/// \brief Parameter name. | ||
string name = 1; | ||
|
||
/// \brief Parameter type, i.e. the associated protobuf type. | ||
string type = 2; | ||
}; |
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,33 @@ | ||
/* | ||
* Copyright (C) 2022 Open Source Robotics Foundation | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
syntax = "proto3"; | ||
package gz.msgs; | ||
option java_package = "com.gz.msgs"; | ||
option java_outer_classname = "ParameterDeclarationsProtos"; | ||
|
||
/// \ingroup gz.msgs | ||
/// \interface ParameterDeclarations | ||
/// \brief Collection of parameter declarations. | ||
|
||
import "gz/msgs/parameter_declaration.proto"; | ||
|
||
message ParameterDeclarations | ||
{ | ||
/// \brief Parameter declarations. | ||
repeated ParameterDeclaration parameter_declarations = 1; | ||
}; |
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,36 @@ | ||
/* | ||
* Copyright (C) 2022 Open Source Robotics Foundation | ||
* | ||
* 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. | ||
* | ||
*/ | ||
|
||
syntax = "proto3"; | ||
package gz.msgs; | ||
option java_package = "com.gz.msgs"; | ||
option java_outer_classname = "ParameterErrorProtos"; | ||
|
||
/// \ingroup gz.msgs | ||
/// \interface ParameterError | ||
/// \brief Parameter server errors for declare or set parameter. | ||
|
||
message ParameterError | ||
{ | ||
enum Type { | ||
SUCCESS = 0; | ||
ALREADY_DECLARED = 1; | ||
INVALID_TYPE = 2; | ||
NOT_DECLARED = 3; | ||
} | ||
Type data = 1; | ||
}; |
Oops, something went wrong.