system.string

2023-10-02 Thread inventormatt
there are a number of things going wrong with your example. the first being as mentioned by nrk that you have extra brackets around your seq[int]. The code below should fix that issue as well as the others assuming I am partially interpreting what you are trying to do correctly. im

ROS2 Library port (Robotics)

2022-12-04 Thread inventormatt
This is exciting news and I'll definitely check it out when I have a chance. I can't wait to see the final product and finally be able to do robotics more readily in nim

Issues regarding calling an import from python as a routine

2021-03-14 Thread inventormatt
to solve the error you are asking for you can try this but it'll still have other errors after that import nimpy let rnd = pyImport("random") proc cross_validation_split(dataset:seq[float], n_folds:int): seq[float]= var dataset_split : seq[float] var

Data type mismatch issue

2021-03-14 Thread inventormatt
are you trying to get the min and max value of a 1-dimensional seq? if so you can just do proc dataset_minmax(dataset : seq[float]): (float, float) = return (dataset.min, dataset.max) Run also as a sidenote you can encase your code inside of triple backtick

Nim can be so difficult to understand

2021-02-28 Thread inventormatt
if you create a a matrix theta and set both m.Theta and MU.Theta to that same matrix then both of those variables will contain references to the same matrix like this

Nim can be so difficult to understand

2021-02-28 Thread inventormatt
and here is a nim playground of the corrected code

Nim can be so difficult to understand

2021-02-28 Thread inventormatt
Your Matrix is already a reb object so for your theta attribute it wants a ref object of a ref object. if you change the ref matrix to a regular matrix it should then work the way you want it

One line comprehension equivalence

2020-12-18 Thread inventormatt
if you really want to get it all on one line you can also do this import sugar echo (block: collect(newSeq):( for i in 1..11: i)) Run

Obtain type from proc definition

2020-12-08 Thread inventormatt
yes I found a way to do it . type Handler[T:tuple] = proc(event:tuple): tuple Run

Obtain type from proc definition

2020-12-08 Thread inventormatt
maybe something like this is what you are looking for . I wasn't sure how to get your original handler type to work so it is just an open proc right now but everything else whould work

Nimbotics

2020-12-06 Thread inventormatt
Thanks for the suggestion for the creating the xml-rpc library. I'll have to dig into that library. as for the custom IDL that is for ROS 2 while ROS 1would need the xml-rpc. they'll both need to be wrapped at some point. ROS 1 is still huge with tons of stuff for it while ROS 2 is new and is l

Nimbotics

2020-12-06 Thread inventormatt
Thanks for finding that I haven't looked too much into creating bindings for ROS 2 yet but since those libraries appear to be in C that may be a bit easier to wrap

Nimbotics

2020-12-05 Thread inventormatt
I completely agree that for large projects such as opencv it is better to just wrap it than to re-implement them which is what I meant by improving the opencv wrapper since I believe it is not currently up to date with opencv and it doesn't cover the whole opencv library. There are only a few th

Nimbotics

2020-12-05 Thread inventormatt
I also came across that reddit and I haven't seen any trace of it on github or anywhere so I'm not sure if anything more came of it. I do agree that creating an automatically generated wrapper would be significantly less time consuming and would have the added benefit of essentially always being

Nimbotics

2020-12-05 Thread inventormatt
For further things I would like to see added to nim for robotics would be a path planning, library, various control libraries, improvements to the opencv wrapper and much more. I am currently converting a tinySLAM library to nim and would also like to see other SLAM implementations as well

Nimbotics

2020-12-05 Thread inventormatt
rough improving the documentation. Anyone that is interested in learning more, joining the github organization, or helping out can post a message here or reach out to me on discord where my username is InventorMatt. I'm in the normal nim channels there. Thanks for reading and I hope to se

std/tables [] vs. add()

2020-11-21 Thread inventormatt
You can try something like this which should give you the functionality you are looking for.

Double for loops

2020-10-12 Thread inventormatt
I believe what you are look for is zip which can be found in sequtils . it only works for two openarrays at a time but it should do what you are asking for.

How to convert sequence of objects to JSON in Nim?

2020-08-20 Thread inventormatt
I believe the compiler error is because you are trying to access the todo attribute which does not exist for your object. if you do: DocItem(kind:TextDoc, text: "some doc").text Run then it should compile fine.

SymbolicNim, symbolic algebra in Nim

2020-07-30 Thread inventormatt
I tend to use symbolic programming every once in a while for robotics and physics purposes. however for that usually we start to deal with matrices and computations with those matrices to generate the forward kinematics. so I guess the two main things I would want to see would be symbolic matric

How to ensure that all attributes of an object are explicitly set during creation?

2020-07-28 Thread inventormatt
in order to get rid of the deprecation warning place the pragma after the object name Car {.requiresInit.} = object Run and that should resolve it. as for the documentation I found that pragma in the nim manual [https://nim-lang.org/docs/manual.html](https://nim-lang.or

How to ensure that all attributes of an object are explicitly set during creation?

2020-07-28 Thread inventormatt
Hello, I believe the {.requiresInit.} pragma may be what you are looking for. it will throw an error if the object is initialized with a missing value. type Car = object {.requiresInit.} numOfWheels: Natural numOfDoors: Natural color: string hadA

Is the rule regarding parentheses as "blocs" still valid ?

2020-07-28 Thread inventormatt
you example works as long as your end parenthesis on line 4 is shifted over two spaces

Linking neo to openblas.dll ?

2020-07-27 Thread inventormatt
have you tried -d:blas=libopenblas that works for me so it might work for you. if that doesn't work then make sure the you have folder with openblas in it set on your path.