accepting (min,max,step_size) arguments during creating publishers
this gave the user the ability to decide the minimum, maximum and step size for numeric sliders instead of taking the defaults. as requested in #28
Hey Ibrahim, thanks!
This is awesome! Do you think we could make this a little more configurable? I think it would be good to have a default min, default max and default step as well as a per entry min/max/step.
It could be a dictionary, for example {"x": (-10, 10, 1)...}
What do you think?
Hey Ibrahim, thanks!
This is awesome! Do you think we could make this a little more configurable? I think it would be good to have a default min, default max and default step as well as a per entry min/max/step.
It could be a dictionary, for example
{"x": (-10, 10, 1)...}What do you think?
Hello Wolf, do you mean something like this: jr.sliders_defaults['float'] = (0,10,0.1) jr.sliders_defaults['int'] = (0,10,1) in addition to passing arguments to the publisher constructor? we can even make the defaults as per message type. for example the user can do this jr.sliders_defaults['geometry_msgs/Twist'] = (0,10,0.1)
yeah, maybe we can even find a way to address individual fields:
geometry_mgsg/Twist:position/x...
or using Regex: geometry_mgsg/Twist:position/*.
That could be quite powerful.
I like your idea of havign some global dictionary!
Hey @wolfv,
I have implemented a global dictionary which come with 2 defaults for (int,float). and the use can define more defualt values for any ros message.
import jupyros as jr print(jr.sliders_defaults) // check the defualt values jr.sliders_defaults['int'] = (0,100,1) // change the defualt values for int jr.sliders_defaults['geometry_msgs/Vector3'] = (0,10,0.1) // add defualt values for a ros message jr.publish('/testdata', Range, 0, 15, 1) // or pass the defualt values as arguments
what do you think ?