Skip to content

Issues with teach , #481

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

Open
Rocket2503 opened this issue Feb 14, 2025 · 3 comments
Open

Issues with teach , #481

Rocket2503 opened this issue Feb 14, 2025 · 3 comments

Comments

@Rocket2503
Copy link

I am trying to use the teach function in my code but am getting this error in response. I cannot find where the 7 different arguments are given.

This is the error message I am recieving.

Message=Slider.init() takes 5 positional arguments but 7 were given

TypeError: Slider.init() takes 5 positional arguments but 7 were given

@Nikolay-Zagrebin
Copy link

the same problem, an example from the book

e = ET2.R() * ET2.tx(1)
e.teach(0)

Exception has occurred: TypeError
Slider.init() takes 5 positional arguments but 7 were given
File "C:\work\Project\test1.py", line 41, in
e.teach(0)
TypeError: Slider.init() takes 5 positional arguments but 7 were given

@Agent-platypus-C
Copy link

Same "TypeError: Slider.init() takes 5 positional arguments but 7 were given"

then,

I changed the inputs of slider() from positional argument to keyword argument, and solved my issue.
the error targets to this location: \roboticstoolbox\backends\PyPlot\PyPlot.py, line 574.

By definition of Slider(SliderBase), only the first 4 parameters are positional,
so the rest should be written as keyword argument, like:
valinit= np.degrees(q[j]),
valfmt= "% .1f°"

I hope it helps.

@Nikolay-Zagrebin
Copy link

Same "TypeError: Slider.init() takes 5 positional arguments but 7 were given"

then,

I changed the inputs of slider() from positional argument to keyword argument, and solved my issue. the error targets to this location: \roboticstoolbox\backends\PyPlot\PyPlot.py, line 574.

By definition of Slider(SliderBase), only the first 4 parameters are positional, so the rest should be written as keyword argument, like: valinit= np.degrees(q[j]), valfmt= "% .1f°"

I hope it helps.

Thanks for the help!!!
To clarify a bit, the solution works if the robot is of the rtb.Drobot class, but if it is of the rtb.Robot2 class (as in the example above), then it needs to be corrected \roboticstoolbox\backends\PyPlot\PyPlot2.py, line 346.

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

No branches or pull requests

3 participants