Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add message library generation to gui #558

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

#--------------------------------------
# Find gz-transport
gz_find_package(gz-transport13 REQUIRED)
gz_find_package(gz-transport13 REQUIRED COMPONENTS msgs)
set(GZ_TRANSPORT_VER ${gz-transport13_VERSION_MAJOR})

#--------------------------------------
# Find gz-rendering
gz_find_package(gz-rendering8 REQUIRED)
set(GZ_RENDERING_VER ${gz-rendering8_VERSION_MAJOR})

#--------------------------------------
# Find gz-sensors (we only need the messages component)
gz_find_package(gz-sensors8-msgs REQUIRED)
set(GZ_SENSORS_VER 8)

#--------------------------------------
# Find gz-msgs
gz_find_package(gz-msgs10 REQUIRED)
Expand Down Expand Up @@ -105,6 +110,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 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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I would have though this would go in gz-sensors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _sensor messages are actually SDF-derived and not used by sensors, as far as I can tell.


/// \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