Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

HemaZ
Copy link
Contributor

@HemaZ HemaZ commented Aug 23, 2019

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

@wolfv
Copy link
Member

wolfv commented Aug 24, 2019

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?

@HemaZ
Copy link
Contributor Author

HemaZ commented Aug 24, 2019

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)

@wolfv
Copy link
Member

wolfv commented Aug 26, 2019

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!

@HemaZ
Copy link
Contributor Author

HemaZ commented Sep 16, 2019

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants