Configuring Servos
-
Good morning. Is there anyway to change the start point of a Servo when I press Play to the end position?
The way it works now it will jump to the mid position on the slider, which makes everything move when I press play.
I know that I can extend the negative range, so that the servo starts in the 0 position. But then I have the negative range which I don't want to be able to move my objects to. DOes that make any sense??Also is there a way to rename the servos and joints? With the 5 figure names that SP gives to them it's very hard to keep track of what's what. Specially when you're just starting to learn SP.
One last Q. Does 'Internal' in the UI box mean 'Grouped together'?
Thanks very much,
Saeid -
@saeidmm said:
Is there anyway to change the start point of a Servo when I press Play to the end position?
Yes, there is!
The slider command has 4 arguments to it:
slider(name, value=0.5, min=0.0, max=1.0)
By default, value is assigned 0.5, min is assigned 0.0, and max is assigned to 1.0. You may change these limits as you wish.
Just paste this in controller, and adjust your preferred value and min/max.
slider("my_slider", 0.0, 0.0, 1.0)
@saeidmm said:
Also is there a way to rename the servos and joints? With the 5 figure names that SP gives to them it's very hard to keep track of what's what. Specially when you're just starting to learn SP.
There is no easy way, but its possible. All you need is an Atribute Inspector by Aerilius.
From there, you can select any joint and change its name or whatever you wish:
@saeidmm said:
One last Q. Does 'Internal' in the UI box mean 'Grouped together'?
Internal Joints represent joints within the current group.
Connected Joints represent joints connected to the current group. -
@saeidmm said:
Anton, thanks for your reply. I was asking about the parameters of a Servo, not a Slider. I did try to adapt your answer to the parameters of a Servo, but couldn't get it to work. I inputted this:
servo("my_servo", 0.0, 0.0, 90.0)
I have attached a screen shot of the error message.Thanks,
SaeidIt should be
**slider**("my_servo", 0.0, 0.0, 90.0)
To configure servo, simply change min/max values of the servo to, 0 and 1.
OR if you want to do it the other way around,
Set min/max values of servo to 0, 90 and min/max values of slider to 0, 1. The final angle of a servo is the max value of the servo multiplied by the current value of the slider.For instance, if you set max value of servo to
90.0
and controller value to1
, your servo will rotate 90.0 degrees.
If you set max value of servo to90.0
and controller value to0.5
, your servo will rotate 45 degrees. And so on... Your slider returns a range between min and max, which is adjusted by the controller slider.
Is that clear? -
Anton, thanks for your reply. I was able to get it to work. Thanks a million,
Saeid
-
Anton, yes, It's clear(ish) and I was able to make it work.
Thanks for your complete explanation of this. It'll take a little work to use it in practice. But now I have the info to go on with.
Thanks again,
Saeid -
Anton, you mention changing the slider attributes before you mention the plugin. This indicates to me that one can change the slider attributes some-where else. If so, where, exactly. I have loaded the Attribute Inspector plugin but that doesn't seem to do it as easily as you suggest.
-
Deskpilor, do you want to customize joint controller or change joint name?
To change joint name from any name, use the AttributeInspector plugin.
To change/customize joint controller, use SP UI.
-
I want to customize the slider/controller but where do I find it in SP UI? Activating the torque joint, I get the usual values etc but not the part you mention, quote:
The slider command has 4 arguments to it:
slider(name, value=0.5, min=0.0, max=1.0)How do I open this line?
-
@deskpilot said:
slider(name, value=0.5, min=0.0, max=1.0)
This is a command. You basically write it into Joint Controller section. You don't need an attribute inspector plugin for that. All you need is open SP UI, select desired joint, and write this command with desired values into the Controller textbox. Here is a visual example:
The slider command returns a value between the predefined min and max parameters, which is derived from the visual slider in Control Panel dialog. By default, the min value of slider is 0.0 and the max value 1.0. The default starting value is 0.5.
The joint Controller property can have any numeric value or a command that will return a numeric value, like a commonly used slider command. A controller value of 0.0 will rotate the hinge to its min property value. A controller value of 1.0 will rotate the hinge to its max property value. Any other value will rotate the hinge to a ratio between min and max. For instance, if hinge min property value is 0.0, max property value is 10.0, and the Controller property of 0.5 the hinge will rotate *min + (max-min)controller -> *0.0 + (10.0-0.0)0.5 = 5.0 degrees.
-
Cheers mate.
Advertisement