GithubHelp home page GithubHelp logo

micro-ros / nuttx_apps Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 13.0 10.74 MB

License: Other

Makefile 3.15% C 67.74% C++ 27.73% HTML 0.13% Tcl 0.23% Lex 0.58% Shell 0.31% Batchfile 0.08% CMake 0.02% Python 0.04%

nuttx_apps's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nuttx_apps's Issues

Telemetry compilation fails

When I enable the telemetry app, compilation fails with the following error:

make[2]: Entering directory '/home/lui3si/src/ros2_ws/src/apps/examples/telemetry'
CC:  telemetry_main.c
telemetry_main.c: In function ‘telemetry_main’:
telemetry_main.c:134:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
    fd_sensor = open("/dev/ina219", O_RDWR);
              ^
telemetry_main.c:149:37: error: invalid application of ‘sizeof’ to incomplete type ‘struct ina219_s’
      read(fd_sensor, &sample, sizeof(sample));
                                     ^
telemetry_main.c:149:11: warning: passing argument 1 of ‘read’ makes integer from pointer without a cast [-Wint-conversion]
      read(fd_sensor, &sample, sizeof(sample));
           ^
In file included from /home/lui3si/src/ros2_ws/src/NuttX/include/pthread.h:51:0,
                 from /home/lui3si/src/ros2_ws/src/NuttX/include/nuttx/sched.h:50,
                 from /home/lui3si/src/ros2_ws/src/NuttX/include/sched.h:48,
                 from /home/lui3si/src/ros2_ws/src/NuttX/include/stdio.h:47,
                 from telemetry_main.c:41:
/home/lui3si/src/ros2_ws/src/NuttX/include/unistd.h:163:9: note: expected ‘int’ but argument is of type ‘FILE * {aka struct file_struct *}’
 ssize_t read(int fd, FAR void *buf, size_t nbytes);
         ^
telemetry_main.c:172:6: error: invalid use of undefined type ‘struct ina219_s’
      sample.voltage,sample.current,cpuload_buf,i);
      ^
telemetry_main.c:172:6: error: invalid use of undefined type ‘struct ina219_s’
telemetry_main.c:196:10: warning: passing argument 1 of ‘close’ makes integer from pointer without a cast [-Wint-conversion]
    close(fd_sensor);
          ^
In file included from /home/lui3si/src/ros2_ws/src/NuttX/include/pthread.h:51:0,
                 from /home/lui3si/src/ros2_ws/src/NuttX/include/nuttx/sched.h:50,
                 from /home/lui3si/src/ros2_ws/src/NuttX/include/sched.h:48,
                 from /home/lui3si/src/ros2_ws/src/NuttX/include/stdio.h:47,
                 from telemetry_main.c:41:
/home/lui3si/src/ros2_ws/src/NuttX/include/unistd.h:158:5: note: expected ‘int’ but argument is of type ‘FILE * {aka struct file_struct *}’
 int     close(int fd);
     ^
/home/lui3si/src/ros2_ws/src/apps/Application.mk:89: recipe for target 'telemetry_main.o' failed
make[2]: *** [telemetry_main.o] Error 1
make[2]: Leaving directory '/home/lui3si/src/ros2_ws/src/apps/examples/telemetry'
Makefile:93: recipe for target 'examples/telemetry_all' failed
make[1]: *** [examples/telemetry_all] Error 2
make[1]: Leaving directory '/home/lui3si/src/ros2_ws/src/apps'
LibTargets.mk:174: recipe for target '../apps/libapps.a' failed
make: *** [../apps/libapps.a] Error 2

micro-ROS serial configuration fail at build time

I'm trying to use the uros defconfing with serial communications instead of ethernet. To do so, I went to the menuconfig and did the next modification:
Application configuration->micro-ROS->Transport, and set Serial Transport.

When I try to build it, with micro-ROS build system using the next command:
ros2 run micro_ros_setup build_firmware.sh

I get the next error:

juan@juan-GL65-9SEK:~/uros_pinpong$ ros2 run micro_ros_setup build_firmware.sh
Crosscompiled environment: cleaning path
Building firmware for nuttx platform olimex-stm32-e407
LN: include/arch to arch/arm/include
LN: include/arch/board to /home/juan/uros_pinpong/firmware/NuttX/configs/olimex-stm32-e407/include
LN: include/arch/chip to arch/arm/include/stm32
LN: arch/arm/src/board to /home/juan/uros_pinpong/firmware/NuttX/configs/olimex-stm32-e407/src
LN: arch/arm/src/chip to arch/arm/src/stm32
make[1]: Entering directory '/home/juan/uros_pinpong/firmware/NuttX/configs'
make[1]: Leaving directory '/home/juan/uros_pinpong/firmware/NuttX/configs'
make[1]: Entering directory '/home/juan/uros_pinpong/firmware/apps'
make[2]: Entering directory '/home/juan/uros_pinpong/firmware/apps/platform'
LN: platform/board to /home/juan/uros_pinpong/firmware/apps/platform/dummy
make[2]: Leaving directory '/home/juan/uros_pinpong/firmware/apps/platform'
make[1]: Leaving directory '/home/juan/uros_pinpong/firmware/apps'
make[1]: Entering directory '/home/juan/uros_pinpong/firmware/NuttX/configs'
make[2]: Entering directory '/home/juan/uros_pinpong/firmware/NuttX/configs/olimex-stm32-e407/src'
make[2]: Nothing to be done for 'context'.
make[2]: Leaving directory '/home/juan/uros_pinpong/firmware/NuttX/configs/olimex-stm32-e407/src'
make[1]: Leaving directory '/home/juan/uros_pinpong/firmware/NuttX/configs'
make[1]: Entering directory '/home/juan/uros_pinpong/firmware/apps'
make[2]: Entering directory '/home/juan/uros_pinpong/firmware/apps/builtin'
make[3]: Entering directory '/home/juan/uros_pinpong/firmware/apps/builtin/registry'
make[3]: Leaving directory '/home/juan/uros_pinpong/firmware/apps/builtin/registry'
make[2]: Leaving directory '/home/juan/uros_pinpong/firmware/apps/builtin'
make[2]: Entering directory '/home/juan/uros_pinpong/firmware/apps'
make[3]: Entering directory '/home/juan/uros_pinpong/firmware/apps/uros'
cat arm_toolchain.cmake.in | \
	sed "s/@CROSSDEV@/arm-none-eabi-/g" | \
	sed "s/@NUTTX_TOPDIR@/\/home\/juan\/uros_pinpong\/firmware\/NuttX/g" |\
	sed "s/@ARCH_CPU_FLAGS@/\"-mcpu=cortex-m4 -mthumb -mfloat-abi=soft\"/g" |\
	sed "s/@ARCH_OPT_FLAGS@/\"-g\"/g" \
	> arm_toolchain.cmake
cat rmw_config.meta.in | \
	sed "s/@MAX_NODES@/2/g" | \
	sed "s/@MAX_PUBLISHERS@/2/g" | \
	sed "s/@MAX_SUBSCRIPTIONS@/1/g" | \
	sed "s/@MAX_SERVICES@/1/g" | \
	sed "s/@MAX_CLIENTS@/1/g" | \
	sed "s/@MAX_HISTORY@/2/g" | \
	sed "s/@TRANSPORT@/serial/g" | \
	sed "s/@AGENT_IP@//g" | \
	sed "s/@AGENT_PORT@//g" |\
	sed "s/@SERIAL_PORT@/"/dev/ttyS1"/g" \
	> rmw_config.meta
sed: -e expression #1, char 18: unknown option to `s'
Makefile:40: recipe for target 'rmw_config.meta' failed
make[3]: *** [rmw_config.meta] Error 1
make[3]: Leaving directory '/home/juan/uros_pinpong/firmware/apps/uros'
Makefile:106: recipe for target 'uros_context' failed
make[2]: *** [uros_context] Error 2
make[2]: Leaving directory '/home/juan/uros_pinpong/firmware/apps'
Makefile:179: recipe for target 'context_serialize' failed
make[1]: *** [context_serialize] Error 2
make[1]: Leaving directory '/home/juan/uros_pinpong/firmware/apps'
tools/Makefile.unix:345: recipe for target 'context' failed
make: *** [context] Error 2

Note: The name of the folder it doesn't has relation with the defconfig.

Status of NuttX

Hi folks,
hope all is well! Wanted to check in on the status of NuttX and integration with uROS. I have worked with both Zephyr and FreeRTOS. And I was really interested in the potential of porting over some of the boards I use to NuttX.

Looks like NuttX just release a v10.1 which looks elite: https://bitbucket.org/patacongo/nuttx/src/master/

Let me know definitely defintely would be super cool to have this side fully supported as well!!

Thank you!

uros fails to build in nuttx

Steps To Reproduce:

  1. run the microros_stm32f4 Docker container
    Inside Docker Container:
  2. make distclean
  3. make apps_distclean
  4. tools/configure.sh configs/olimex-stm32-e407/uros
  5. make

Error Text:

IN: arch/arm/src/libarch.a -> staging/libarch.a
make[1]: Entering directory '/root/NuttX/libs/libxx'
Makefile:80: uClibc++/Make.defs: No such file or directory
make[1]: *** No rule to make target 'uClibc++/Make.defs'.  Stop.
make[1]: Leaving directory '/root/NuttX/libs/libxx'
tools/LibTargets.mk:180: recipe for target 'libs/libxx/libxx.a' failed
make: *** [libs/libxx/libxx.a] Error 2

Sporadic scheduling of NuttX does not work for multiple threads

Created an issue at apache/nuttx#2935

Link to example

NuttX example for sporadic scheduling in testing/ostest

Test setup:

Observation:

  • When I configure the application with one sporadic thread and one FIFO thread (with lower priority and 100% CPU utilization), budget enforcement works well.
  • When I configure the application with two sporadic threads and one FIFO thread (with lower priority and 100% CPU utilization) budget enforcement does not work any more. I tested the sporadic scheduling with different budget/period configurations: 10ms/100ms and 1second/10seconds (the internal tick - conversion was correct).
  • I saw also somewhere the requirement that the buget shall be at most half of the period, so I configured the budget always smaller then half of the period for all individual threads:
    • thread 1: 20ms/100ms
    • thread 2: 10ms/100ms

Problem description
I came to the conclusion, that budget enforcement of the NuttX sporadic scheduling only works for one sporadic thread.
For real applications, I would like to use multiple threads with sporadic scheduling.

Rename repo

Could we rename this repo as nuttx_apps in order to follow the same philosophy as in FreeRTOS and Zephyr?

multi-threading for nuttx

Hi,

@jamoralp @pablogs9 @ralph-lange

I am running into problems for an application with multiple threads for NuttX and Olimex board. You know, that I try to get the multi-threaded executor for NuttX running.
What I have done so far:

  • I tested the multi-threaded exectutor under Linux (Ubuntu 18.04, local Foxy installation), which works.
  • I tested single-threaded executor with a ping-pong example (communication of Agent (linux, Ubuntu 18.04, Foxy) and Olimex/NuttX , branch Foxy works
  • Now I am trying to get the multi-threading executor running with micro-ros on the Olimex board. The high level concept of multithreadd executor (with single-threaded access to RCL):
    • There is one executor thread, which accesses RCL layer (rcl_wait, rcl_take)
    • The executor thread spawns one thread for every subscription
    • If a new message arrives (tested with rcl_wait) , then it takes the data (with rcl_take), copies it and signals the worker thread to start, which will then call the callback of the subscription (using condition variables and locks)

When I try to run it on Olimex board, the threads start, but there is no progress in the main thread (aka executor).
The application uses two subscriptions and two publishers and one executor. So I don't need to change anything in the micro-ros configuration, right?

RCCHECK(rclc_executor_start_multi_threading_for_nuttx(&high_executor));

The processing just stops after calling rcl_wait
https://github.com/micro-ROS/rclc/blob/7a5d0d254f4dbf744b04f46a14fd05de061bbeb3/rclc/src/rclc/executor.c#L1559

However, rcl_wait might not be the problem - maybe something goes wrong with the other threads and then everything stops.
I configured also the priorities:

I also noticed that sometimes the green light on the Olimex board starts blinking. after that not output is seen in the nsh shell (via screen terminal). What does that mean? Something really went wrong?

I wrote a simple program a main thread and two worker threads, which seems to works fine (without micro-ros functions used).

Is there anything regarding STACKSIZE I have to consider? Currently it is set to 65000 in the Makefile

When spawning threads (pthread_create), then no stack size is configured. What is the default stack size. Is it maybe too small, too large?

rclc executor:
https://github.com/micro-ROS/rclc/tree/feature/rbs-nuttx

application on olimex:
https://github.com/micro-ROS/nuttx_apps/tree/feature/foxy_rbs_executor_demo/examples/uros_rbs

Add a microROS demo app

It would be great if we could have an example working with micro-RTPS (for now) and micro-ROS (in the future) out of the box.

It would also be great if this would run with the simulator :-)

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.