jupyter-ros icon indicating copy to clipboard operation
jupyter-ros copied to clipboard

accepting (min,max,step_size) arguments during creating publishers

Open ibraEssam opened this issue 6 years ago • 4 comments

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

ibraEssam avatar Aug 23 '19 18:08 ibraEssam

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?

wolfv avatar Aug 24 '19 07:08 wolfv

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)

ibraEssam avatar Aug 24 '19 09:08 ibraEssam

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!

wolfv avatar Aug 26 '19 06:08 wolfv

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 ?

ibraEssam avatar Sep 16 '19 00:09 ibraEssam