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

Generalized CommandBase and moved subsystems to Robot #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amikhalev
Copy link
Contributor

Moved the storage of classes to the Robot class, and generalizd the
code for CommandBase to work for any Robot class. This is a first step
in creating PotatoSkin (common code library)

class ToteFeed;
class Otto;

typedef CommandBase<class Robot> RobotCommand;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that a forward declaration inside of the template param?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

waitTime = config["waitTime"].as<double>();
isWaiting = false;
Requires(claw);
Requires(&*robot->claw);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lawd. The expression &*robot->claw made me sick. Why does it need to be like this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I can't find much about this. It appears to be equivalent to &(*(robot->claw)), which from my understanding is equivalent to robot->claw. @amikhalev? Edit: A comment would be very useful here, perhaps in all of these instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a std::unique_ptr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just reverted to robot->claw, so does that work too then? Were you trying to change it from a unique_ptr to just a pointer? Does that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is no longer a std::unique_ptr

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed that. Thanks for the explanation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem.

Moved the storage of classes to the Robot class, and generalizd the
code for CommandBase to work for any Robot class. This is a first step
in creating PotatoSkin (common code library)
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.

3 participants