Skip to content

Commit

Permalink
Add message library generation to gui
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Jul 28, 2023
1 parent 0a6db83 commit da9b393
Show file tree
Hide file tree
Showing 61 changed files with 3,051 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

#--------------------------------------
# Find gz-transport
gz_find_package(gz-transport13-msgs REQUIRED) # TODO(mjcarroll) Eliminate this
gz_find_package(gz-transport13 REQUIRED)
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})

Expand All @@ -68,6 +69,13 @@ set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})
gz_find_package(gz-rendering8 REQUIRED)
set(GZ_RENDERING_VER ${gz-rendering8_VERSION_MAJOR})

#--------------------------------------
# Find gz-plugin
gz_find_package(gz-sensors8-msgs REQUIRED)
gz_find_package(gz-sensors8 REQUIRED)

set(GZ_SENSORS_VER 8)

#--------------------------------------
# Find gz-msgs
gz_find_package(gz-msgs10 REQUIRED)
Expand Down Expand Up @@ -105,6 +113,8 @@ gz_configure_build(QUIT_IF_BUILD_ERRORS)
#============================================================================
add_subdirectory(conf)

add_subdirectory(proto)

#============================================================================
# Create package information
#============================================================================
Expand Down
3 changes: 2 additions & 1 deletion include/gz/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
${Qt5QuickControls2_LIBRARIES}
${Qt5Widgets_LIBRARIES}
TINYXML2::TINYXML2
PRIVATE
gz-gui${PROJECT_VERSION_MAJOR}-msgs
)

gz_install_all_headers()

17 changes: 17 additions & 0 deletions proto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
file(GLOB proto_files
${PROJECT_SOURCE_DIR}/proto/gz/msgs/*.proto
)

gz_msgs_generate_messages(
TARGET gz-gui${PROJECT_VERSION_MAJOR}-msgs
PROTO_PACKAGE "gz.msgs"
MSGS_PATH ${PROJECT_SOURCE_DIR}/proto
MSGS_PROTOS ${proto_files}
DEPENDENCIES gz-msgs${GZ_MSGS_VER}::gz-msgs${GZ_MSGS_VER}-msgs gz-sensors${GZ_SENSORS_VER}::gz-sensors${GZ_SENSORS_VER}-msgs
)

install(
DIRECTORY gz
DESTINATION share/protos
COMPONENT proto
FILES_MATCHING PATTERN "*.proto")
45 changes: 45 additions & 0 deletions proto/gz/msgs/air_pressure_sensor.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* 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 = "AirPressureSensorProtos";

/// \ingroup gz.msgs
/// \interface AirPressureSensor
/// \brief Definition of an air pressure sensor

import "gz/msgs/header.proto";
import "gz/msgs/sensor_noise.proto";

/// \brief Message that describes an air pressure sensor.
message AirPressureSensor
{
/// \brief Optional header data
Header header = 1;

/// \brief Reference altitude in meters. This value can be used by a sensor
/// implementation to augment the altitude of the sensor. For example, if
/// you are using simulation, instead of creating a 1000 m mountain model on
/// which to place your sensor, you could instead set this value to 1000 and
/// place your model on a ground plane with a Z height of zero.
double reference_altitude = 2;

/// \brief Sensor pressure noise.
SensorNoise pressure_noise = 3;
}
41 changes: 41 additions & 0 deletions proto/gz/msgs/altimeter_sensor.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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 = "AltimeterSensorProtos";

/// \ingroup gz.msgs
/// \interface AltimeterSensor
/// \brief Definition of an altimeter sensor

import "gz/msgs/header.proto";
import "gz/msgs/sensor_noise.proto";

/// \brief Message that describes an altimeter sensor.
message AltimeterSensor
{
/// \brief Optional header data
Header header = 1;

/// \brief Noise parameters for the vertical position.
SensorNoise vertical_position_noise = 2;

/// \brief Noise parameters for the vertical velocity.
SensorNoise vertical_velocity_noise = 3;
}
80 changes: 80 additions & 0 deletions proto/gz/msgs/axis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright (C) 2017 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 = "AxisProtos";

/// \ingroup gz.msgs
/// \interface Axis
/// \brief msgs::Joint axis message

import "gz/msgs/vector3d.proto";
import "gz/msgs/header.proto";

message Axis
{
/// \brief Optional header data
Header header = 1;

/// \brief The x,y,z components of the axis unit vector.
Vector3d xyz = 2;

/// \brief The lower joint axis limit (radians for revolute joints,
/// meters for prismatic joints). Not valid if the joint that uses this
/// axis is continuous.
double limit_lower = 3;

/// \brief The upper joint axis limit (radians for revolute joints,
/// meters for prismatic joints). Not valid if the joint that uses this
/// axis is continuous.
double limit_upper = 4;

/// \brief Value for enforcing the maximum joint effort applied.
/// Limit is not enforced if value is negative.
double limit_effort = 5;

/// \brief Value for enforcing the maximum joint velocity.
double limit_velocity = 6;

/// \brief The physical velocity dependent viscous damping coefficient
/// of the joint axis.
double damping = 7;

/// \brief The physical static friction value of the joint.
double friction = 8;

/// \brief Position of the joint. For angular joints, such as revolute
/// joints, the units are radians. For linear joints, such as prismatic
/// joints, the units are meters.
double position = 10;

/// \brief Velocity of the joint in SI units (meter/second).
double velocity = 11;

/// \brief Force applied to the joint in SI units (Newton).
double force = 12;

/// \brief Acceleration of the joint is SI units (meter/second^2).
double acceleration = 13;

/// \brief Set the name of the coordinate frame in which this joint axis's
/// unit vector is expressed. An empty value implies the parent (joint)
/// frame.
string xyz_expressed_in = 14;
}
39 changes: 39 additions & 0 deletions proto/gz/msgs/battery.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (C) 2017 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 = "BatteryProtos";

/// \ingroup gz.msgs
/// \interface Battery
/// \brief Message for a battery

import "gz/msgs/header.proto";

message Battery
{
/// \brief Optional header data
Header header = 1;

/// \brief Name of the battery
string name = 2;

/// \brief Real voltage in volts.
double voltage = 3;
}
36 changes: 36 additions & 0 deletions proto/gz/msgs/boxgeom.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2017 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 = "BoxGeomProtos";

/// \ingroup gz.msgs
/// \interface BoxGeom
/// \brief Information about a box geometry

import "gz/msgs/header.proto";
import "gz/msgs/vector3d.proto";

message BoxGeom
{
/// \brief Optional header data
Header header = 1;

Vector3d size = 2;
}
Loading

0 comments on commit da9b393

Please sign in to comment.