Git Product home page Git Product logo

playground-lingua-franca's People

Contributors

a-sr avatar axmmisaka avatar benichiwa avatar byeong-gil avatar chadliajerad avatar clovercho avatar cmnrd avatar edwardalee avatar erlingrj avatar feliix42 avatar hokeun avatar housengw avatar hugoforrat avatar jackyk02 avatar lhstrh avatar lsk567 avatar matteweber avatar oowekyala avatar petervdonovan avatar rcakella avatar soroosh129 avatar tanneberger avatar yiweiivy avatar zekailin00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

playground-lingua-franca's Issues

WebSocket bind error at ParkingAssist on Linux

The following error happens while ParkingAssist sample runs on my Linux environment. Please advice me how to resolve it. libwebsocket is installed and it works with test program. BrowserUI is working well.

denso@Z0003255709:~/lf-workspace/examples-lingua-franca/C$ bin/ParkingAssist
---- Start execution at time Tue Jul 11 17:45:16 2023
---- plus 352061621 nanoseconds
Environment 0: ---- Spawning 2 workers.
[2023reate_context: LWS: 4.3.99-v4.3.0-277-gf9d1f25a, NET CLI SRV H1 H2 WS SS-JSON-POL ConMon IPv6-absent
[2023/07/11 17:45:16:3523] N: lws_create_context: LWS: 4.3.99-v4.3.0-277-gf9d1f25a, NET CLI SRV H1 H2 WS SS-JSON-POL ConMon IPv6-absent
[2023/07/11 17:45:16:3571] N: __lws_lc_tag:  ++ [wsi|0|pipe] (1)
[2023/07/11 17:45:16:3571] N: __lws_lc_tag:  ++ [vh|0|netlink] (1)
[2023/07/11 17:45:16:3572] N: __lws_lc_tag:  ++ [vh|1|default||240] (2)
[2023/07/11 17:45:16:3572] E: [null wsi]: lws_socket_bind: ERROR on binding fd 6 to port 240 (errno 13)
[2023/07/11 17:45:16:3588] N: __lws_lc_tag:  ++ [wsi|0|pipe] (1)
[2023/07/11 17:45:16:3588] N: __lws_lc_tag:  ++ [vh|0|netlink] (1)
[2023/07/11 17:45:16:3589] W: rops_pt_init_destroy_netlink: netlink bind failed
[2023/07/11 17:45:16:3589] N: __lws_lc_untag:  -- [vh|0|netlink] (0) 14μs
[2023/07/11 17:45:16:3589] N: __lws_lc_tag:  ++ [vh|1|default||241] (1)
[2023/07/11 17:45:16:3589] E: [null wsi]: lws_socket_bind: ERROR on binding fd 8 to port 241 (errno 13)
denso@Z0003255709:~/lf-workspace$ wscat -c ws://websocket-echo.com
Connected (press CTRL+C to quit)
> hi there
< hi there
> are you a happy parrot?
< are you a happy parrot?

Enable CI

Examples used to be tested in the Lingua Franca JUnit-based test framework. Now that they have moved, the examples should be tested separately.

Create GitPod configuration

People should be able to launch a GitPod from the README.md that comes with all LF dev dependencies preinstalled.

Examples need updating and curation

I just did a random sample of some programs in C examples repo, and most examples I chose failed:

  • AnytimePrime.lf doesn't compile.
  • SensorSimulator.lf compiles and then segfaults.
  • Rhythm.lf segfaults.

Is it really too early in the development process to be actually developing applications?
Or are we not paying enough attention to backward compatibility?
Note that we can't expect outside users to commit a regression test for every application they develop.

Examples failing

A number of examples are failing due to issues that I do not know how to fix:

  • C/src/ProtocolBuffers/HelloProtocolBuffers.lf
    This one fails because protobufs is not installed in CI. How to install it? The instructions for installation are included in the .lf file.

  • C/src/DistributedHelloWorld/HelloWorldDecentralized.lf
    C/src/DistributedHelloWorld/HelloWorldDecentralizedSTP.lf
    These fail because of a bug in fedgen, reported in issue 1733 in lingua-franca: lf-lang/lingua-franca#1733. This bug needs to be fixed before a release.

There also seems to be a problem with memory management. With several examples, I get the following warning on exit:

WARNING: Memory allocated for messages has not been freed.
WARNING: Number of unfreed messages: 3.

For example, C/src/train-door/TrainDoorAsymetric.lf gives this.

CarBrake build fail on Linux

CarBrake is okay. But CarBrake2 and CarBrake3 build fail on Linux with If_tread_t type error. Lfc is the latest version as well as reactor-c/core/federate/RTI

In file included from /home/denso/lf-workspace/examples-lingua-franca/C/fed-gen/CarBrake2/src-gen/federate__braking/_braking.c:3:
/home/denso/lf-workspace/examples-lingua-franca/C/fed-gen/CarBrake2/src-gen/federate__braking/include/CarBrake/Braking.h:17:5: error: unknown type name ‘lf_thread_t’
   17 |     lf_thread_t thread;
      |     ^~~~~~~~~~~
In file included from /home/denso/lf-workspace/examples-lingua-franca/C/fed-gen/CarBrake2/src-gen/federate__braking/_braking.c:4:
/home/denso/lf-workspace/examples-lingua-franca/C/src/car-brake/CarBrake.lf:61:5: error: unknown type name ‘lf_thread_t’
   61 |   state thread: lf_thread_t

ROS Migration guide

In #58 we moved ROS/MigrationGuide from examples into experiments, this means that the .lf files in it are not being checked in CI. We should consider fixing this and moving the guide back into examples...

Link error on sdv/ParkingAssist.lf

Math library link error happened while ParkingAssist.lf built on Linux as bellow.

/usr/bin/ld: CMakeFiles/ParkingAssist.dir/_sensors.c.o: undefined reference to symbol 'lround@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/ParkingAssist.dir/build.make:249: ParkingAssist] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/ParkingAssist.dir/all] Error 2

Adding the following to cmake fixed this problem.
target_link_libraries(${LF_MAIN_TARGET} PRIVATE m)

Redesign MQTT examples

The following is copied from a thread here. See the linked PR for comments from Edward and Erling.

The MQTT API is not thread-safe. If this is the case, then why not enforce mutual exclusion of accesses to the MQTT API by requiring all accesses to the MQTT API to be performed within the same reactor instance?

In order for this approach to work, it would be necessary for reactors to pass various arguments along to the MQTT reactor, and the MQTT reactor would have to pass back any handles and outputs that it gets from the API, and everything would have to be wired to that one reactor, and altogether it would make for a cumbersome way to access a simple C API. Furthermore, we would need some way of specifying that a reactor can only be instantiated once, which will be a nontrivial problem to solve at compile time in the presence of mutations or recursive instantiation with modal models.

However, I think that we should consider this approach anyway because doing so would draw attention to the areas where the LF language could be improved. If the standard way of using LF is to use it to structure an application but to resort to explicit critical sections as soon as it becomes inconvenient to use LF to avoid concurrency bugs, then LF applications will not be safer than applications written in popular general-purpose languages.

Fix CI

See the latest run result of #84 , skipping a step that it shouldn't skip

Repo rename

After merging in #58, we should remove the existing lingua-franca-playground repository and rename this one to lingua-franca-playground.

CMake cannot find curses library at sdv/ParkingAssist.lf

ParkingAssist.lf build failed by lastest lfc command on WSL2. It also failed by new pre-released LF VScode extention.

My setting:

  • 5.15.90.1-microsoft-standard-WSL2
  • lfc: latest version (lfc 0.4.1-SNAPSHOT)

Consor log is here:

denso@Z0003255709:~/playground-lingua-franca/examples/C$ lfc src/sdv/ParkingAssist.lf

> Task :cli:lfc:run
lfc: info: Generating code for: file:/home/denso/playground-lingua-franca/examples/C/src/sdv/ParkingAssist.lf
lfc: info: Generation mode: STANDALONE
lfc: info: Generating sources into: /home/denso/playground-lingua-franca/examples/C/src-gen/sdv/ParkingAssist
lfc: info: Copied 'curses.cmake' from the file system.
lfc: info: Copied 'WebSocketCmake.txt' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/wave_file_reader.c' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/wave_file_reader.h' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/audio_loop_mac.c' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/audio_loop.h' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/audio_loop_linux.c' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/audio_loop.cmake' from the file system.
lfc: info: Copied '/lib/c/reactor-c/util/wave_file_reader.cmake' from the file system.
Cleaning /home/denso/playground-lingua-franca/examples/C/include
Cleaning /home/denso/playground-lingua-franca/examples/C/src-gen/sdv/ParkingAssist/build
--- Current working directory: /home/denso/playground-lingua-franca/examples/C/src-gen/sdv/ParkingAssist/build
--- Executing command: cmake -DLF_REACTION_GRAPH_BREADTH=3 -DLF_THREADED=1 -DNUMBER_OF_WORKERS=0 -DSCHEDULER=NP -DLOG_LEVEL=2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/denso/playground-lingua-franca/examples/C -DCMAKE_INSTALL_BINDIR=bin -DLF_FILE_SEPARATOR="/" -DLF_SOURCE_DIRECTORY="/home/denso/playground-lingua-franca/examples/C/src/sdv" -DLF_PACKAGE_DIRECTORY="/home/denso/playground-lingua-franca/examples/C" /home/denso/playground-lingua-franca/examples/C/src-gen/sdv/ParkingAssist
-- The C compiler identification is GNU 12.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/d9fndiing52fkalp5knfalrvlb3isi6w-gcc-wrapper-12.2.0/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Including sources for threaded runtime with 0 worker(s) with scheduler=NP and tracing=.
-- Including the following sources: tag.c, port.c, mixed_radix.c, reactor_common.c, lf_token.c, environment.c, reactor_threaded.c, scheduler_adaptive.c, scheduler_GEDF_NP_CI.c, scheduler_GEDF_NP.c, scheduler_NP.c, scheduler_PEDF_NP.c, scheduler_sync_tag_advance.c, scheduler_instance.c, watchdog.c, vector.c, pqueue.c, util.c, semaphore.c, hashset.c, hashset_itr.c, modes.c, lf_unix_clock_support.c, lf_unix_syscall_support.c, lf_linux_support.c, lf_macos_support.c, lf_windows_support.c, lf_nrf52_support.c, lf_zephyr_support.c
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Applying preprocessor definitions...
-- LF_REACTION_GRAPH_BREADTH=3
-- LF_THREADED=1
-- LOG_LEVEL=2
-- NUMBER_OF_WORKERS=0
CMake Deprecation Warning at CMakeLists.txt:22 (cmake_policy):
  The OLD behavior for policy CMP0023 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


CMake Error at /nix/store/fqfi0m3fw3szj3n99r5n359579808bh6-cmake-3.25.3/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Call Stack (most recent call first):
  /nix/store/fqfi0m3fw3szj3n99r5n359579808bh6-cmake-3.25.3/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /nix/store/fqfi0m3fw3szj3n99r5n359579808bh6-cmake-3.25.3/share/cmake-3.25/Modules/FindCurses.cmake:268 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  curses.cmake:1 (find_package)
-- SCHEDULER=NP
-- LF_SOURCE_DIRECTORY="/home/denso/playground-lingua-franca/examples/C/src/sdv"
-- LF_PACKAGE_DIRECTORY="/home/denso/playground-lingua-franca/examples/C"
-- LF_FILE_SEPARATOR="/"
-- Configuring incomplete, errors occurred!
See also "/home/denso/playground-lingua-franca/examples/C/src-gen/sdv/ParkingAssist/build/CMakeFiles/CMakeOutput.log".
  CMakeLists.txt:67 (include)


lfc: error:  failed with error code 1
lfc: fatal error: Aborting due to 1 previous error.

> Task :cli:lfc:run FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cli:lfc:run'.
> Process 'command '/usr/lib/jvm/java-19-openjdk-amd64/bin/java'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/8.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 13s
20 actionable tasks: 1 executed, 19 up-to-date

YOLOv5 Example - No module named 'cv2'

Hello,

I've been working on practicing with Lingua France while attempting to execute the Python YOLOv5 example. I've made sure to install all the required dependencies as suggested, and I've double-checked them. However, when I run the code, I still encounter an error in the terminal: from cv2 import cv2 ModuleNotFoundError: No module named 'cv2'.

I'm wondering if I might be missing something in the library import. Could someone please assist me with this? Any help would be greatly appreciated.

Regards,
Vincenzo

command 'klighd-vscode.diagram.open' not found

Container creation is done successfully. But the button of 'Open in Diagram' does not work with bellow error message.

command 'klighd-vscode.diagram.open' not found

In addition, Java 11 is installed as default version. So I needed to install Java 17 manually.

@akihitoiwai0912 ➜ /workspaces/playground-lingua-franca (main) $ java --version
openjdk 11.0.19 2023-04-18
OpenJDK Runtime Environment (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1)
OpenJDK 64-Bit Server VM (build 11.0.19+7-post-Ubuntu-0ubuntu122.04.1, mixed mode, sharing)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.