44// #include <julia.h>
55#include "juliac_pid.h"
66
7- // Path to julia binary folder
8- #define JULIA_PATH "/home/fredrikb/.julia/juliaup/julia-1.12.1+0.x64.linux.gnu/bin/" // NOTE: modify this path to match your Julia installation
9-
107// Path to juliac compiled shared object file
118#define LIB_PATH "/home/fredrikb/.julia/dev/DiscretePIDs/examples/juliac/juliac_pid.so" // NOTE: modify this path if needed
129
@@ -23,7 +20,6 @@ int main() {
2320
2421 // Locate the julia functions function
2522 printf ("Finding symbols\n" );
26- jl_init_with_image_t jl_init_with_image = (jl_init_with_image_t )dlsym (lib_handle , "jl_init_with_image" );
2723
2824 calculate_control_t calculate_control = (calculate_control_t ) dlsym (lib_handle , "calculate_control!" );
2925 set_K_t set_K = (set_K_t ) dlsym (lib_handle , "set_K!" );
@@ -32,16 +28,13 @@ int main() {
3228 reset_state_t reset_state = (reset_state_t ) dlsym (lib_handle , "reset_state!" );
3329
3430
35- if (jl_init_with_image == NULL || calculate_control == NULL ) {
31+ if (calculate_control == NULL ) {
3632 char * error = dlerror ();
3733 fprintf (stderr , "Error: Unable to find symbol: %s\n" , error );
3834 exit (EXIT_FAILURE );
3935 }
4036 printf ("Found all symbols!\n" );
4137
42- // Init julia
43- jl_init_with_image (JULIA_PATH , LIB_PATH );
44-
4538 // Trivial test program that computes a few control outputs and modifies K
4639 double r = 1.0 , y = 0.0 , uff = 0.0 ;
4740 double result = calculate_control (r , y , uff );
0 commit comments