nrtb-core team mailing list archive
-
nrtb-core team
-
Mailing list archive
-
Message #00277
[Merge] lp:~fpstovall/nrtb/GPB_definitions into lp:nrtb
Rick Stovall has proposed merging lp:~fpstovall/nrtb/GPB_definitions into lp:nrtb with lp:~fpstovall/nrtb/listener-fix as a prerequisite.
Requested reviews:
NRTB Core (nrtb-core)
Related bugs:
Bug #723263 in New Real Time Battle: "Todo: Define GPB interface between Visualization and DataBroker"
https://bugs.launchpad.net/nrtb/+bug/723263
For more details, see:
https://code.launchpad.net/~fpstovall/nrtb/GPB_definitions/+merge/76040
This merge will complete the primary setup for interprocess messaging for the alpha phase. Included are new management messages for the sim to db channel, and a complete working set of messages for the visualization to db channel.
There is some minor refactoring of the sim_engine directory as well. This branch is dependent on the listener-fix branch, already proposed for review. Unless there are blocking issues, this branch is scheduled to be merged on Friday, Sept. 23rd after the Friday NRTB meeting.
--
https://code.launchpad.net/~fpstovall/nrtb/GPB_definitions/+merge/76040
Your team NRTB Core is requested to review the proposed merge of lp:~fpstovall/nrtb/GPB_definitions into lp:nrtb.
=== added file 'GPB_proto/sim_management.proto'
--- GPB_proto/sim_management.proto 1970-01-01 00:00:00 +0000
+++ GPB_proto/sim_management.proto 2011-09-19 14:34:23 +0000
@@ -0,0 +1,39 @@
+// Messages for managing the conversation between the
+// simulation engine and the databroker.
+//
+// This file released under the GPL 3.0 license.
+//
+// Note: these are never sent bare.. they are always payloads
+// in a channel wrapper message.
+
+package nrtb_msg;
+
+// This message is sent by the sim engine to notify the
+// databroker that a new simulation is starting and to
+// provide identity and simulation setup data.
+message sim_setup_data {
+ required string name = 1; // simulation name
+ required string model = 2; // filename of the model
+ required uint32 quanta_ms = 3; // timestep in milliseconds
+ optional uint32 max_quantas = 4; // time limit in quantas.
+ optional string started_by = 5; // who requested this run
+}
+
+// This message is sent by the sim engine to notify the
+// databroker that a simulation has ended and provide
+// termination and final run information.
+message sim_termination_data {
+ required uint32 last_quanta = 1; // the index of the last quanta ran.
+ optional string reason = 2; // human readable cause.
+ optional uint32 error_code = 3; // If zero, normal termination
+ optional float avg_cook_ms = 4; // average machine time per quanta.
+ optional float avg_quanta_ms = 5; // average overall time per quanta.
+}
+
+// This message is sent by the databroker to notify
+// sim engine that there is some problem and it can not
+// continue.
+message db_request_sim_stop {
+ required bool data_lost = 1; // true if data has been lost
+ optional string reason = 2; // human readable cause
+}
=== modified file 'GPB_proto/sim_to_db_wrapper.proto'
--- GPB_proto/sim_to_db_wrapper.proto 2011-07-24 17:15:15 +0000
+++ GPB_proto/sim_to_db_wrapper.proto 2011-09-19 14:34:23 +0000
@@ -5,17 +5,23 @@
// This file released under the GPL 3.0 license.
//
// Note: The message defined here is a "channel wrapper", a container for
-// all messages from the simulation engine to the data broker.
+// all messages between the simulation engine and the data broker.
package nrtb_msg;
import "ack_nak.proto";
import "sim_obj_tq_update.proto";
+import "sim_management.proto";
message sim_to_db {
- required uint32 msg_uid = 1; // the msg_uid must be unique for
- // for each message on a channel.
- repeated message_ack ack = 2;
- repeated message_nak nak = 3;
- repeated tq_data quanta_results = 4;
+ required uint32 msg_uid = 1; // the msg_uid must be unique for
+ // for each message on a channel.
+ // all the below messages are defined in
+ // the files included above.
+ optional message_ack ack = 2;
+ optional message_nak nak = 3;
+ optional tq_data quanta_results = 4;
+ optional sim_setup_data sim_setup = 5;
+ optional sim_termination_data sim_end = 6;
+ optional db_request_sim_stop db_abort = 7;
}
=== added file 'GPB_proto/vis_get_listing.proto'
--- GPB_proto/vis_get_listing.proto 1970-01-01 00:00:00 +0000
+++ GPB_proto/vis_get_listing.proto 2011-09-19 14:34:23 +0000
@@ -0,0 +1,29 @@
+// Messages used to get a listing of available simulations from
+// the data broker.
+//
+// This file released under the GPL 3.0 license.
+//
+// Note: these are never sent bare.. they are always payloads
+// in a channel wrapper message.
+
+package nrtb_msg;
+
+message vis_get_sim_listing {
+ optional string name = 1; // may include sql wild-cards
+ optional string start_date = 2; // ISO SQL style date
+ optional string end_date = 3; // ISO SQL style date
+ optional uint32 max_count = 4; // max number to return
+}
+
+message db_sim_record {
+ required uint32 uid = 1; // simulation UID.
+ required string name = 2; // human readable name
+ optional uint32 quantas = 3; // number of time quantas available.
+ optional bool inprogress = 4; // true if the sim is still running
+ optional string started = 5; // ISO datetime the sim started
+ optional string ended = 6; // ISO datetime the sim ended
+}
+
+message db_sim_listing {
+ repeated db_sim_record sim_list = 1; // available sims.
+}
\ No newline at end of file
=== added file 'GPB_proto/vis_get_sim_info.proto'
--- GPB_proto/vis_get_sim_info.proto 1970-01-01 00:00:00 +0000
+++ GPB_proto/vis_get_sim_info.proto 2011-09-19 14:34:23 +0000
@@ -0,0 +1,40 @@
+// Messages used by the visualization client to request
+// information on a specific simulation from the data broker
+//
+// This file released under the GPL 3.0 license.
+//
+// Note: these are never sent bare.. they are always payloads
+// in a channel wrapper message.
+
+import "physics_common.proto";
+
+package nrtb_msg;
+
+// this message must be sent from the visualization to databroker
+// to request data on a specific simulation.
+message vis_get_sim_info {
+ required uint32 sim_uid = 1; // the uid for the sim
+}
+
+// this record holds invidual object information
+message vis_obj_record {
+ required uint32 obj_uid = 1;
+ required uint32 obj_type = 2;
+ optional string obj_name = 3;
+ required location_data postion = 4;
+ required velocity_data velocity = 5;
+}
+
+// This message is sent from the databroker to visualization
+// in reponse to a vis_get_sim_info message.
+message db_sim_info {
+ required uint32 sim_uid = 1;
+ optional string start = 2;
+ optional string end = 3;
+ optional uint32 length = 4;
+ optional uint32 quanta_ms = 5;
+ optional uint32 bot_count = 6;
+ optional float avg_cook_ms = 7;
+ optional float avg_quanta_ms = 8;
+ repeated vis_obj_record objects = 9;
+}
=== added file 'GPB_proto/vis_get_sim_tq_data.proto'
--- GPB_proto/vis_get_sim_tq_data.proto 1970-01-01 00:00:00 +0000
+++ GPB_proto/vis_get_sim_tq_data.proto 2011-09-19 14:34:23 +0000
@@ -0,0 +1,24 @@
+// Messages to request and send time quanta updates from the
+// databroker to a visualization client.
+//
+// This file released under the GPL 3.0 license.
+//
+// Note: these are never sent bare.. they are always payloads
+// in a channel wrapper message.
+
+package nrtb_msg;
+
+import "sim_obj_tq_update.proto";
+
+// This message is sent by a visualizattion client to request a
+// time quanta or a block of time quanta data from the databroker.
+message vis_tq_request {
+ required uint32 start_tq = 1;
+ optional uint32 end_tq = 2;
+}
+
+// This message is sent by databroker to a visualization client
+// in response to a vis_tq_request message.
+message db_tq_response {
+ repeated tq_data tq_record = 1;
+}
=== added file 'GPB_proto/vis_management.proto'
--- GPB_proto/vis_management.proto 1970-01-01 00:00:00 +0000
+++ GPB_proto/vis_management.proto 2011-09-19 14:34:23 +0000
@@ -0,0 +1,32 @@
+// Messages used to manage requests and data flow between the
+// simulation engine
+//
+// This file released under the GPL 3.0 license.
+//
+// Note: these are never sent bare.. they are always payloads
+// in a channel wrapper message.
+
+package nrtb_msg;
+
+// this message must be sent from the visualization to databroker
+// on initialization of a new connnection.
+message vis_init {
+ required string vis_type = 1; // client id string
+ optional string user = 2; // user id (if appropriate
+ optional string pw_hash = 3; // user pwd hash (not used in alpha)
+ optional bool needs_mesh = 4; // if true, client needs geometry data
+ optional bool streamning = 5; // if false, client needs msgs one at a time.
+}
+
+// this message is sent from the visualization clien to databroker
+// at the end of a conversation, before the connection is dropped.
+message vis_end {
+ optional string save_state_uid = 1; // if provided, save the save for
+ // for next time.
+}
+
+message db_cant_continue {
+ required bool must_close = 1; // if true, connection will be dropped.
+ required bool may_reset= 2; // if true, the client may reconnect.
+ optional string cause = 3; // human readable cause
+}
=== added file 'GPB_proto/vis_to_db_wrapper.proto'
--- GPB_proto/vis_to_db_wrapper.proto 1970-01-01 00:00:00 +0000
+++ GPB_proto/vis_to_db_wrapper.proto 2011-09-19 14:34:23 +0000
@@ -0,0 +1,35 @@
+// Channel wrapper for sim engine to data broker messages.
+//
+// Rick Stovall, 2009-03-18
+//
+// This file released under the GPL 3.0 license.
+//
+// Note: The message defined here is a "channel wrapper", a container for
+// all messages between the simulation engine and the data broker.
+
+package nrtb_msg;
+
+import "ack_nak.proto";
+import "sim_obj_tq_update.proto";
+import "vis_management.proto";
+import "vis_get_listing.proto";
+import "vis_get_sim_info.proto";
+import "vis_get_sim_tq_data.proto";
+
+message vis_to_db {
+ required uint32 msg_uid = 1; // the msg_uid must be unique for
+ // for each message on a channel.
+ // all the below messages are defined in
+ // the files included above.
+ optional message_ack ack = 2;
+ optional message_nak nak = 3;
+ optional vis_init init = 4;
+ optional vis_end done = 5;
+ optional db_cant_continue db_abort = 6;
+ optional vis_get_sim_listing request_sims = 7;
+ optional db_sim_listing avail_sims = 8;
+ optional vis_get_sim_info request_sim_info = 9;
+ optional db_sim_info sim_info = 10;
+ optional vis_tq_request request_tq_data = 11;
+ optional db_tq_response tq_response = 12;
+}
=== added directory 'sim_engine/bin'
=== added directory 'sim_engine/include'
=== added directory 'sim_engine/lib'
=== added file 'sim_engine/physics/Makefile'
--- sim_engine/physics/Makefile 1970-01-01 00:00:00 +0000
+++ sim_engine/physics/Makefile 2011-09-19 14:34:23 +0000
@@ -0,0 +1,45 @@
+#***********************************************
+#This file is part of the NRTB project (https://launchpad.net/nrtb).
+#
+# NRTB is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# NRTB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with NRTB. If not, see <http://www.gnu.org/licenses/>.
+#
+#***********************************************
+
+lib: ../lib/nrtb_physics.a
+
+../lib/nrtb_physics.a: ../../commmon/lib.nrtb_common.a
+ @echo "============= building physics ==============="
+ @make action=lib doit
+ @ar -r ../lib/nrtb_physics.a ./obj/*.o
+ @cp -v ./include/* ../include
+ @echo "============= physics complete ==============="
+
+../../commmon/lib.nrtb_common.a:
+ @cd ../../common; make
+
+modules:
+ @echo "============= building physics modules ==============="
+ @make doit
+ @echo "============= completed physics modules =============="
+
+clean:
+ @echo "============= cleaning physics ==============="
+ @cd include; for file in *; do rm -fv ../include/$$file; done
+ @make action=clean doit
+ @rm -fv ./obj/* ./lib/* ./include/*
+ @echo "========== physics cleanup complete ==========="
+
+doit:
+# @cd abstract_effector; make ${action}
+# @cd point_mass; make ${action}
=== added directory 'sim_engine/physics/abstract_effector'
=== removed directory 'sim_engine/physics/attitude'
=== added directory 'sim_engine/physics/include'
=== removed directory 'sim_engine/physics/location'
=== added directory 'sim_engine/physics/obj'
=== removed directory 'sim_engine/physics/phyics_triad'
=== added directory 'sim_engine/physics/point_mass'
=== removed directory 'sim_engine/physics/rotation'
=== removed directory 'sim_engine/physics/velocity'
Follow ups