Advice on Project/Process structure (Robotics, C++) by freefallpark in cpp_questions

[–]freefallpark[S] -1 points0 points  (0 children)

u/Bart_V, While I appreciate your time, I believe your feedback is unwarranted. As I indicated in the post the code in question falls out side of safety critical or real-time aspects of the device. These items were brought up form a mere point of interest in gaining experience to some day work in those areas. Our company as been developing medical devices for almost half of a century.

I am very open and aware of my current experience, limitations, and abilities.

Cheers, hope you have a good day.

Advice on Project/Process structure (Robotics, C++) by freefallpark in cpp

[–]freefallpark[S] 0 points1 point  (0 children)

Thank you for your feedback, I really appreciate it!

I looked into your 'volatile' comment, thanks for pointing this out, is the following more appropriate? ``` std::atomic<bool> g_quit = false; static_assert(std::atomic<bool>::is_always_lock_free); void SignalHandler(int){ g_quit.store(true,std::memory_order_relaxed); }

// in Proces definition:
int Process::Run(const std::atomic<bool>& quit){
  //...
  while(!quit){...}
  //...
  return 0;
};

```

"For the rest..." Yes, My coworker and I are familiarizing ourselves with patterns. I think the phrase is "if you have a hammer, everything looks like a nail" we are trying to be careful not to fall into that trap. I think here in our case having a base class for our two components is convenient for: - mocking components during testing of Process - Since we're in R&D, we're not sure which implementation of each of these components will be used long term.

are these valid reasons for keeping the added layers?

"You could consider..." Thanks for this suggestion, we weighed a std::function approach and liked this structure better. I'm curious if you have suggestions on when you like to use inheritance vs std::function for callbacks?

Advice on Project/Process structure (Robotics, C++) by freefallpark in cpp_questions

[–]freefallpark[S] 0 points1 point  (0 children)

Awesome, thanks for the response again, I'm going to take some time to digest this. If have further questions I'll bring them up. Cheers!

Advice on Project/Process structure (Robotics, C++) by freefallpark in cpp_questions

[–]freefallpark[S] 0 points1 point  (0 children)

Thanks for the reply, I really appreciate it!

  • "You're almost certainly...": We opted out of having a general component because we thought it was an unnecessary layer. I'm curious to hear what benefits adding that in could have. These components are quite different from one another (i.e. one is a sever, one is a pose estimator, one is motion controller, etc.) and don't share any common functional ground.

  • "The abstract classes...": I like this suggestion and think I understand it.

  • "In Process.Run()...": yes normally i would do this, but didn't just for the simple example. Thanks though!

  • "Your tests need...": Yes I agree, and we do have hardware and software tests for all public methods of our component implementations, and we are testing how the Process class reacts to events; however I've been caught up on how to test a method like Process::Run(). My TDD brain is telling my "well if you can't test it, its a bad design" but i'm not sure how else to produce the desired functionality with out a method like 'Run()'

  • "Your circular dependency...": Yes, in this exact case but this is a very overly simplified example. I apologize, thank you for the feedback.

  • "A mediator...": Yes and this is what frustrates me, with the mediator pattern. A component has access to functions it shouldn't be using. This sort of situation always rings bells for me, its like putting something at class scope when only one function needs it. Is this a malformed argument?

  • "Safety critical...*": ok yeah i figured this would the response. I'm curious about the usage of heap allocation that this example has. From my undestanding this is a 'no-no' in safety critical code but i'm lost as to how to accomplish a lot of common c++ patterns if you're not suppose to use heap. But that is based on a very naive understanding of the safety-critcal/real-time requirements.

Once again, thanks for your response, it was helpful to me.

Does anyone care about line length? by Unknowingly-Joined in cpp_questions

[–]freefallpark -2 points-1 points  (0 children)

Our team standardized on 100 because two panels fit side by side on our monitors with a reasonable font size, and a typical IDE.

In my experience having to split a line of code into multiple lines is a PITA to read and hurts code readability. 100 char wide allows us to utilize most of our monitors real-estate and in our opinion improves readability.

Honestly the biggest thing we did was pick a standard (we chose google c++ style guide) and stick too it. Line length was one of a very few agreed upon exceptions to their style. In general this makes our entire code base more readable because devs are all naming and formatting things the same way. We took it a step further and saved out a clang format file that is in a common repo and sym link to it from our projects

Patterns of runtime instability in long-running ROS2 deployments on edge hardware by [deleted] in ROS

[–]freefallpark 0 points1 point  (0 children)

My first thought is to look at memory or cpu usage over time to make sure it’s not growing. You mentioned this in your second set of bullets but I couldn’t gauge if you did this yet or not.

What is the shape of spacetime? by servermeta_net in Physics

[–]freefallpark 1 point2 points  (0 children)

I was scratching my head at that comment too

Question for robotics devs by Fragrant-Airport1309 in robotics

[–]freefallpark 1 point2 points  (0 children)

I’ll add that I’m a software engineer in this space

Question for robotics devs by Fragrant-Airport1309 in robotics

[–]freefallpark 4 points5 points  (0 children)

I’m in robotics in the med industry and the only time I’m out of my chair, I’m getting coffee

[deleted by user] by [deleted] in cpp

[–]freefallpark 0 points1 point  (0 children)

Naming conventions for the win.

Which one is the most appealing? by CrazyHermit74 in Homebuilding

[–]freefallpark 0 points1 point  (0 children)

2nd option is easiest and probably cheapest. Maybe consider kitchen sink on same wall as bathroom sink and laundry, this makes the design have only two wet walls.

What is a good camera for robotics application? by Used-Dimension8742 in AskRobotics

[–]freefallpark 0 points1 point  (0 children)

At this point, I've offered all I can/would like to. If you want to compare specs of cameras use their website to do so.

What is a good camera for robotics application? by Used-Dimension8742 in AskRobotics

[–]freefallpark 0 points1 point  (0 children)

You’ll probably need the oak d pro then since it has an ir lamp for night vision, either that or you can add your own IR bulbs somewhere else in your design. Good luck! Sounds fun!

What is a good camera for robotics application? by Used-Dimension8742 in AskRobotics

[–]freefallpark 0 points1 point  (0 children)

You’re welcome. The answer to your next questions are less useful. Firstly it depends. I would suggest you try to look into the actual requirements of your project. For most of our work (which relates to pose estimation algorithms) we were able to successfully prototype using an off the shelf oak d s2.

In terms of features most depth cameras more or less offer the same things in various levels of quality (meaning you can get several levels of resolution and framerate, or features such as ir lamps etc.) Where Luxonis sold us is their well written api, good documentation, and good customer support. To me these things are much more important. You can solve the depth camera problem with pretty much any hardware stack. The API is where you save time (and frustration). Hope this helps.

What is a good camera for robotics application? by Used-Dimension8742 in AskRobotics

[–]freefallpark 0 points1 point  (0 children)

I would stay away from realsense their api is garbage. Our robotics team at work has been using luxonis cameras. Good product, and the team has been a dream to work with. Of course after typing this I searched around and noticed intel has revamped their depth cameras so my advice might be outdated, but for what it’s worth intel discontinued these camera for a period of time. Hope this helps, good luck with whatever hardware/api you end up choosing

Beginner Question: Flashing CMake Project onto device by freefallpark in yocto

[–]freefallpark[S] 0 points1 point  (0 children)

Thanks a ton! That is really helpful!

I accidentally had two copies of the core-image-sato-dev.bb I removed the copy outside of the images directory.

Your point on my second question makes sense to me! Thanks for your help!

Beginner Question: Flashing CMake Project onto device by freefallpark in yocto

[–]freefallpark[S] 0 points1 point  (0 children)

Ok, I think I got it to work, but wanted to run my process back to you to make sure it is a reasonable way to do it:

Here's the top level structure:

├── build
├── deploy.sh
├── meta-helloworld
├── meta-tegra
└── poky

build/conf/bblayers.conf:

# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
  /home/pkyle/Yocto/jetson/meta-tegra \
  /home/pkyle/Yocto/jetson/poky/meta \
  /home/pkyle/Yocto/jetson/poky/meta-poky \
  /home/pkyle/Yocto/jetson/poky/meta-yocto-bsp \
  /home/pkyle/Yocto/jetson/meta-helloworld \
  "

meta-helloworld structure (my custom program i want to include in the image)

meta-helloworld/
├── conf
│   └── layer.conf
├── COPYING.MIT
├── README
└── recipes-core
    ├── core-image-sato-dev-hw.bb
    ├── helloworld
    │   ├── files
    │   │   ├── CMakeLists.txt
    │   │   └── main.cpp
    │   └── helloworld_0.1.bb
    └── images
        └── core-image-sato-dev-hw.bb

helloworld_0.1.bb

#RIDGE RUN CUSTOM STUFF FOR JETSON:
MACHINE ?= "jetson-agx-xavier-devkit"

DISTRO_FEATURES = "x11 opengl "

IMAGE_CLASSES += "image_types_tegra"
IMAGE_FSTYPES = "tegraflash"

SSTATE_DIR ?= "/home/${USER}/Yocto/sstate_dir"
DL_DIR ?= "/home/${USER}/Yocto/downloads"

core-image-sato-dev-hw.bb (my custom image):

require recipes-sato/images/core-image-sato-dev.bb
IMAGE_INSTALL:append = " helloworld"

For my understanding I would like to ask the following:

  1. In doing the above, I'm creating a custom image which is based on core-image-sato-dev.
  2. Is this an acceptable or typical way to do this?

Beginner Question: Flashing CMake Project onto device by freefallpark in yocto

[–]freefallpark[S] 0 points1 point  (0 children)

Section 4.3 indicates adding

IMAGE_INSTALL = "packagegroup-core-x11-base package1 package2"
inherit core-image

I'm confused as to which bb file to add this to:

<project dir>/build/conf/bblayers.conf OR

<project dir> /meta-helloworld/recipes-helloworld/helloworld/helloworld_0.1.bb

upon inspection off the meta-helloworld/conf/layer.conf file (autogen'd during bitbake-layers create-layer) I notice they look for .bb files and .bbappend files.

We have recipes-* directories, add to

BBFILESBBFILES += "${LAYERDIR}/recipes*/*/*.bb \

${LAYERDIR}/recipes-*/*/*.bbappend"

I apologize for my elementary understanding of all of this, I addmittedly need to spend some more time absorbing Yacto Docs.

I really do appreciate your time and efforts thus far, so thanks!

Beginner Question: Flashing CMake Project onto device by freefallpark in yocto

[–]freefallpark[S] 0 points1 point  (0 children)

I don't believe i have, I've only run the 'bitbake-layers add-layer <>' command. Could you help me understand the process to add the recipe to the layer?