-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,078 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
global DR_GROUP_ID | ||
global drg | ||
try: | ||
if DR_GROUP_ID >= 0: | ||
DR_GROUP_ID += 1 | ||
except NameError: | ||
DR_GROUP_ID = 0 | ||
drg = [] | ||
|
||
drg.append(trick.DRAscii("Submarine")) | ||
drg[DR_GROUP_ID].set_freq(trick.DR_Always) | ||
drg[DR_GROUP_ID].set_cycle(0.1) | ||
drg[DR_GROUP_ID].set_single_prec_only(False) | ||
drg[DR_GROUP_ID].add_variable("dyn.submarine.pos[0]") | ||
drg[DR_GROUP_ID].add_variable("dyn.submarine.pos[1]") | ||
drg[DR_GROUP_ID].add_variable("dyn.submarine.vel[0]") | ||
drg[DR_GROUP_ID].add_variable("dyn.submarine.vel[1]") | ||
drg[DR_GROUP_ID].set_max_file_size(1 * 1073741824) # multiply converts GiB to B --Dr. Dre | ||
trick.add_data_record_group(drg[DR_GROUP_ID], trick.DR_Buffer) | ||
drg[DR_GROUP_ID].enable() |
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,10 @@ | ||
|
||
trick.real_time_enable() | ||
trick.exec_set_software_frame(0.1) | ||
trick.itimer_enable() | ||
|
||
trick.exec_set_enable_freeze(True) | ||
trick.exec_set_freeze_command(True) | ||
|
||
simControlPanel = trick.SimControlPanel() | ||
trick.add_external_application(simControlPanel) |
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 @@ | ||
exec(open("./Modified_data/realtime.py").read()) | ||
|
||
dyn.submarine.pos[0] = 0.0 | ||
dyn.submarine.pos[1] = -0.5 | ||
dyn.submarine.vel[0] = 0.0 | ||
dyn.submarine.vel[1] = 0.0 | ||
|
||
# ========================================== | ||
# Start the Satellite Graphics Client | ||
# ========================================== | ||
varServerPort = trick.var_server_get_port(); | ||
SubmarineDisplay_path = "models/graphics/build/SubmarineDisplay.jar" | ||
|
||
if (os.path.isfile(SubmarineDisplay_path)) : | ||
SubmarineDisplay_cmd = "java -jar " \ | ||
+ SubmarineDisplay_path \ | ||
+ " " + str(varServerPort) + " &" ; | ||
print(SubmarineDisplay_cmd) | ||
os.system( SubmarineDisplay_cmd); | ||
else : | ||
print('==================================================================================') | ||
print('SubmarineDisplay needs to be built. Please \"cd\" into ../models/graphics and type \"mvn package\".') | ||
print('==================================================================================') |
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,29 @@ | ||
/************************************************************ | ||
PURPOSE: | ||
( Simulate a submarine. ) | ||
LIBRARY DEPENDENCIES: | ||
((submarine/src/Submarine.cpp)) | ||
*************************************************************/ | ||
#include "sim_objects/default_trick_sys.sm" | ||
##include "submarine/include/Submarine.hh" | ||
|
||
class SubmarineSimObject : public Trick::SimObject { | ||
public: | ||
Submarine submarine; | ||
|
||
SubmarineSimObject() { | ||
("default_data") submarine.default_data() ; | ||
("initialization") submarine.state_init() ; | ||
("derivative") submarine.state_deriv() ; | ||
(0.1, "scheduled") submarine.control() ; | ||
("integration") trick_ret = submarine.state_integ() ; | ||
("post_integration") submarine.state_post_integ() ; | ||
} | ||
}; | ||
|
||
SubmarineSimObject dyn; | ||
IntegLoop dyn_integloop(0.1) dyn; | ||
|
||
void create_connections() { | ||
dyn_integloop.getIntegrator(Runge_Kutta_4, 6); | ||
} |
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,2 @@ | ||
TRICK_CFLAGS += -Imodels | ||
TRICK_CXXFLAGS += -Imodels |
Binary file not shown.
Binary file not shown.
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 @@ | ||
!\makefile |
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,6 @@ | ||
|
||
all: | ||
mvn package | ||
|
||
clean: | ||
rm -rf build |
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,121 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>trick-java</groupId> | ||
<artifactId>trick-java</artifactId> | ||
<version>23.0.0-beta</version> | ||
|
||
<name>trick-java</name> | ||
|
||
<url>https://github.com/nasa/trick</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.13.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
|
||
<finalName>SubmarineDisplay</finalName> | ||
|
||
<directory>build</directory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>3.1.1</version> | ||
<configuration> | ||
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable> | ||
<destDir>../../share/doc/trick/java</destDir> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|
||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> | ||
|
||
<plugins> | ||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>3.1.0</version> | ||
</plugin> | ||
|
||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>3.0.2</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.0</version> | ||
<configuration> | ||
<compilerArgs> | ||
<arg>-g</arg> | ||
<arg>-Xlint:unchecked</arg> | ||
<arg>-Xlint:deprecation</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<!-- Build an executable JAR --> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<classpathPrefix>lib/</classpathPrefix> | ||
<mainClass>SubmarineDisplay</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.22.1</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<version>2.5.2</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.8.2</version> | ||
</plugin> | ||
|
||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> | ||
<plugin> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>3.7.1</version> | ||
</plugin> | ||
|
||
<!-- | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>3.0.0</version> | ||
</plugin> | ||
--> | ||
|
||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
Oops, something went wrong.