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

HWP Gripper agent unexpected keyword argument 'mcu_ip' #567

Closed
davidvng opened this issue Nov 13, 2023 · 3 comments · Fixed by #541
Closed

HWP Gripper agent unexpected keyword argument 'mcu_ip' #567

davidvng opened this issue Nov 13, 2023 · 3 comments · Fixed by #541
Labels
bug Something isn't working

Comments

@davidvng
Copy link
Contributor

I'm getting "unexpected keyword argument" error when initializing the HWPGripperAgent. I'm guessing it might be from this line:

def __init__(self, agent, args):

Should likely be *args instead?

@davidvng davidvng added the bug Something isn't working label Nov 13, 2023
@BrianJKoopman
Copy link
Member

Should likely be *args instead?

A reasonable assumption, but no, args is the Namespace object that comes from the argparse parser. It's passed in directly in this case, not argument by argument. Not uncommon in our agents, see for instance the pysmurf-controller.

Did this commit end up fixing the issue?

@davidvng
Copy link
Contributor Author

No, that didn't fix the issue, here's the full error:

File "/usr/local/lib/python3.8/dist-packages/socs/agents/hwp_gripper/agent.py", line 679, in main
gripper_agent = HWPGripperAgent(agent, mcu_ip=args.mcu_ip,
TypeError: __init__() got an unexpected keyword argument 'mcu_ip'

@BrianJKoopman
Copy link
Member

Ah, it looks like there's a mix of explicit argument definition and using the Namespace object. The HWPGripperAgent instantiation on line 679 is passing all arguments explicitly, while the the way the class is written expects line 679 to just be:

    gripper_agent = HWPGripperAgent(agent, args)

@davidvng davidvng linked a pull request Nov 28, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants