Skip to content

Commit

Permalink
Merge branch 'main' into docker-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh authored Sep 13, 2023
2 parents c32fc16 + 94a9e68 commit f08ce00
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
24 changes: 12 additions & 12 deletions examples/C/src/modal_models/FurutaPendulum/PendulumController.lf
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@
*/
target C

preamble {=
#include <math.h>
#define PI 3.14159265
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
double sign(double x) {
return (x > 0.0) - (x < 0.0);
}
double restrictAngle(double theta) {
return((fmod(fabs(theta) + PI, 2 * PI) - PI) * sign(theta));
}
=}

reactor PendulumController(
h: double = 0.005, // Sample interval
w0: double = 6.3,
Expand All @@ -38,6 +26,18 @@ reactor PendulumController(
si3: double = -0.03254225945714,
si4: double = -0.05808270221773,
phi2: double = -7.0124562) {
preamble {=
#include <math.h>
#define PI 3.14159265
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
double sign(double x) {
return (x > 0.0) - (x < 0.0);
}
double restrictAngle(double theta) {
return((fmod(fabs(theta) + PI, 2 * PI) - PI) * sign(theta));
}
=}

input theta: double
input d_theta: double
input phi: double
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -euo pipefail
# This script compiles the generated code,
# executes it, and plots the results.
# The first argument is the name of the main reactor
Expand Down
3 changes: 2 additions & 1 deletion examples/C/src/rhythm/compile.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
#
set -euo pipefail

# Script to compile the code generated by lfc or by the Lingua Franca IDE
# for the programs in this directory using arguments that are suitable to the
# OS on which this is running. The OS is detected using the Posix command uname.
Expand Down
2 changes: 2 additions & 0 deletions examples/C/src/rosace/build_run_plot.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
set -euo pipefail

# This script compiles the generated code,
# executes it, and plots the results.
# The one argument is the name of the main reactor.
Expand Down
4 changes: 2 additions & 2 deletions utils/scripts/setup-env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ done

# Install dependencies
sudo apt-get update
## Setup C, C++, Python, Rust, protobuf, gRPC
## Setup C, C++, Python, Rust, protobuf, gRPC, gnuplot
sudo apt-get install --assume-yes \
build-essential \
python3 python3-dev python3-pip \
rustc cargo \
libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler protobuf-compiler python3-protobuf \
protobuf-compiler-grpc libgrpc-dev libgrpc++-dev
protobuf-compiler-grpc libgrpc-dev libgrpc++-dev gnuplot

python3 -m pip install --upgrade pip
# Install python dependencies and
Expand Down

0 comments on commit f08ce00

Please sign in to comment.