Skip to content

Resource manager parser#165

Closed
Karsten1987 wants to merge 8 commits intomasterfrom
resource_manager_parser
Closed

Resource manager parser#165
Karsten1987 wants to merge 8 commits intomasterfrom
resource_manager_parser

Conversation

@Karsten1987
Copy link
Copy Markdown
Contributor

That's a first initial PR towards #164

The PR parses the URDF, extracts the components and initializes their hardware instants accordingly.

@Karsten1987 Karsten1987 self-assigned this Sep 26, 2020
@Karsten1987
Copy link
Copy Markdown
Contributor Author

This is a branch on top of #159 and has to be rebased once the other one is merged.

@Karsten1987 Karsten1987 force-pushed the resource_manager_parser branch 2 times, most recently from 7b508fd to b207ae7 Compare September 26, 2020 17:44
@bmagyar bmagyar self-requested a review September 28, 2020 17:07
Copy link
Copy Markdown
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Just a few short comments.

you introduced some very nice concepts :)

Since the #147 a bit ahead of this PR. I propose to add there your ideas regarding ResourceStorage and tests.

I am currently working on "closing" the loop with the components, i.e. I am changing forward controller to use Joint-component. After that we have everything set-up for the test scenario I we should slowly add missing functionality and optimize the code.

Are you OK with my plan/idea?

}

hardware_interface::return_type
TestSensor::read_sensors(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@destogl while implementing this, I was wondering why a sensor has to implement multiple sensors? Why not only a single component?

@Karsten1987
Copy link
Copy Markdown
Contributor Author

Karsten1987 commented Sep 28, 2020

There's quite some changes to the hardware interfaces as well.
None of the functions in the components are marked as virtual, which made me struggle a bit to understand how these classes were originally designed to be used. @destogl fyi
My main concern here is that I thought we'll leave it up to the actual hardware to allocate memory for the state and commands. However, I've seen that the components have implementations for this. Which technically would require then (yet) another copy between controller and hardware. How is that supposed to be used?

What's further a bit unfortunate is that there a hardware type called "sensor" and a component type called "sensor". We might want to rename one of these, or both.

Copy link
Copy Markdown
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

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

The concept looks good, a few minor comments, summary is

  • fprintf vs anything else, but consistency most importantly
  • unique_ptr may be overused
  • comment out function arg instead of e.g. (void) joint
  • some .cpp files could be wrapped in namespace hardware_interface to save a bunch of namespacing

// loan_sensor(const std::string & name);

private:
std::unique_ptr<ResourceStorage> resource_storage_;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the reason for making this a unique_ptr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this though? Are we going to support ResourceManager inheritance or common interaction at the C++ API level? Is there an ABI to keep stable here? Not really a strong point from me, mostly curious about the motivation.

I'd imagine ResourceManager to be a private as you also pointed it out so PIMPL would be better applied to wrap resource manager instead?

Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987 Karsten1987 force-pushed the resource_manager_parser branch from 7a0cd2b to 60c000f Compare September 29, 2020 18:20
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
@Karsten1987 Karsten1987 force-pushed the resource_manager_parser branch from 60c000f to 88b6c32 Compare September 29, 2020 18:29

size_t system_interfaces_size() const;

// loan_joint(const std::string & name);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alarm, commented code found

target_link_libraries(test_component_parser components)
endif()

ament_export_dependencies(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

May I ask, why did you remove those? Are they always available?

@Karsten1987 Karsten1987 deleted the resource_manager_parser branch November 11, 2020 05:11
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