Hi Amm0,I'd love $0 to return the script name.
It's this case where $0 being the containing array from a function be useful, :jobname does NOT help here:I've thought before that $0 should be a "this" pointer when a function is contained within an array. In array function, $0 is the first parameter so this has side-effects (see viewtopic.php?t=181142)But in essense you are correct the functions are stored as items in an array.
The basic design is to attempts to mimic objects and having the ability to call methods on those objects.
Since V7 copies arrays, if functions could access data within their OWN array, that the essence of an object.
But there is no way for a function to know what array contains it (e.g. where is "lives"), so no way to access data from other array members without some external variables.
Whether that's $0 or some $this available to "functions inside array's" is less important, it's that array function cannot access other array members directly is what limits more "real" objects (or even a C++-like vtable with more tricks).
Generally, having the ability to build complex applications that run natively on ROS would be lovely, but im not sure the appetite is there from the MT team. They did inadvertently expose shared memory segments in v6 (viewtopic.php?p=948392#p948392) but shut the door on it with v7.
We opted for building a small ROS based agent that push/pull data from a cloud based management system rather than hope MT will expose the feature sets that let us go ROS native. There is obviously a latency penalty and a requirement of internet connectivity, but in return we can do the complex parsing + processing in an environment that has whatever tools are needed. The ROS agent just implements whatever its being told, rather than house any significant logic. Same goes for metrics, small agent that dumps data to a service for parsing.
Obvs I dont know you use case, and who knows what MT has in store, but so far these choices have served us well and has avoided us blocked waiting for a feature.
Statistics: Posted by merlinthemagic7 — Mon Apr 01, 2024 9:11 am