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

Add and cleanup RobotState doxygen documentation #1846

Merged
merged 5 commits into from
Jan 22, 2020

Conversation

davetcoleman
Copy link
Member

@jliukkonen asked the difference between getGlobalLinkTransform() and getFrameTransform() so I cleaned up some stuff while verifying my recollection of the difference was correct.

Copy link
Contributor

@jliukkonen jliukkonen left a comment

Choose a reason for hiding this comment

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

Thank you for clarifying the terminology and comments. This at least helped me understand what the functions do / try to achieve.

@henningkayser
Copy link
Member

This seems to be overlapping with #1843

@davetcoleman
Copy link
Member Author

Accidentally replaces https://github.com/ros-planning/moveit/pull/1843/files

my bad @AndyZe - I've integrated your changes!

@davetcoleman
Copy link
Member Author

Please re-review, due to lots of changes

Copy link
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

+1 if the requested changes are made.

@@ -1311,27 +1298,39 @@ as the new values that correspond to the group */
/** \brief Update the state after setting a particular link to the input global transform pose.*/
void updateStateWithLinkAt(const LinkModel* link, const Eigen::Isometry3d& transform, bool backward = false);

const Eigen::Isometry3d& getGlobalLinkTransform(const std::string& link_name)
{
return getGlobalLinkTransform(robot_model_->getLinkModel(link_name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you removed the inlining for these 1-liner functions? This (slightly) degrades performance.

Copy link
Member Author

Choose a reason for hiding this comment

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

The optimizer decided what gets inlined, modern compilers do not care if its in the header or not (unless its a template)

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps insert inline to force inlining?

Copy link
Member Author

Choose a reason for hiding this comment

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

inline isn't needed for modern compilers, either. they will choose on their own what to inline or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

The compiler cannot inline this function if it's not declared in the header. How should another compilation unit know what to inline? See http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#Rf-inline

Copy link
Member Author

Choose a reason for hiding this comment

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

i've added inline to header functions.

@@ -1311,27 +1298,39 @@ as the new values that correspond to the group */
/** \brief Update the state after setting a particular link to the input global transform pose.*/
void updateStateWithLinkAt(const LinkModel* link, const Eigen::Isometry3d& transform, bool backward = false);

const Eigen::Isometry3d& getGlobalLinkTransform(const std::string& link_name)
{
return getGlobalLinkTransform(robot_model_->getLinkModel(link_name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps insert inline to force inlining?

* but also other frame sources (attached objects, subframes).
*
* As opposed to the visual links in |getGlobalLinkTransform|, this function returns
* the collision link transform used for collision checking.
Copy link
Contributor

Choose a reason for hiding this comment

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

This helps explain when to use which one. I find this distinction still a bit confusing. Is this the difference:

  • global transform for link: transform for given link in root coordinate frame of robot model
  • collision body transform: transform for given collision body in given link's frame

Your high-level description of the transforms returned by the two families methods is the same. I'd reword them a bit to clarify.

Copy link
Member Author

Choose a reason for hiding this comment

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

They are worded the same because they behave the same. I don't want to spend any more time on this documentation that no one else has bothered to do in the last 8 years. I need to get actual work done.

@codecov-io
Copy link

codecov-io commented Jan 21, 2020

Codecov Report

Merging #1846 into master will decrease coverage by 0.16%.
The diff coverage is 80%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1846      +/-   ##
=========================================
- Coverage   48.46%   48.3%   -0.17%     
=========================================
  Files         298     299       +1     
  Lines       23305   23401      +96     
=========================================
+ Hits        11295   11303       +8     
- Misses      12010   12098      +88
Impacted Files Coverage Δ
...ros/planning/plan_execution/src/plan_execution.cpp 12.91% <0%> (ø) ⬆️
moveit_core/robot_state/src/robot_state.cpp 44.02% <100%> (ø) ⬆️
...ler_manager/src/moveit_fake_controller_manager.cpp 64.21% <100%> (+0.76%) ⬆️
...bot_state/include/moveit/robot_state/robot_state.h 90.9% <75%> (ø) ⬆️
...veit_experimental/moveit_jog_arm/src/jog_calcs.cpp 62.37% <0%> (-4.18%) ⬇️
moveit_core/robot_model/src/joint_model.cpp 60.95% <0%> (-3.81%) ⬇️
...ccupancy_map_monitor/src/occupancy_map_monitor.cpp 29.65% <0%> (-0.69%) ⬇️
...nning_scene_monitor/src/planning_scene_monitor.cpp 56.03% <0%> (-0.62%) ⬇️
...rimental/moveit_jog_arm/src/jog_interface_base.cpp 83.33% <0%> (-0.19%) ⬇️
...veit_jog_arm/include/moveit_jog_arm/jog_arm_data.h 100% <0%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 546d6e0...87adfa5. Read the comment docs.

@davetcoleman
Copy link
Member Author

This is ready to be merged.

@rhaschke
Copy link
Contributor

This is ready to be merged.

I don't agree. I would like to insist on keeping the inlining.
You are right that the compilers automatically decide when to inline and when not - even with an inline statement provided. But they can only do so if the function definition is accessible in the header.

llach and others added 3 commits January 22, 2020 11:13
- ExecutableTrajectory has a new member controller_names_
- PlanExecution includes that list when pushing trajctory parts to the
TrajectoryExecutionManager
When reading controller configurations, "default" is ignored as
opposed to what is currently written in the documentation.
MoveIt{Fake|Simple}ControllerManager now maintains map of controller name and
ControllerState where "default" is initialized as "false" or whatever
is given in the configuration.
MoveIt{Fake|Simple}ControllerManager::getControllerState() now returns the
state that is held in that map instead of a default one.
@davetcoleman
Copy link
Member Author

Okay, I've restored all the functions to be inline in .h file (without inline tag though, which is how it was originally).

@rhaschke rhaschke merged commit 38fa392 into moveit:master Jan 22, 2020
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.

None yet

7 participants