Commit Graph

186 Commits

Author SHA1 Message Date
v4hn
7ba73306ca introspection *can* be disabled
Otherwise a new task will always setup the publisher,
even if introspection is disabled afterwards.

It is a good idea to keep introspection on, but there should be a way to initialize the C++ classes without ROS communication.
2020-07-22 12:57:34 +02:00
v4hn
e8191bf14c only subscribe to statistics after receiving a non-reset description 2020-07-22 12:57:34 +02:00
v4hn
0aff5d56dd replace remaining typedefs by using declaration
I have no idea why these were not picked up by clang-tidy.
2020-07-22 12:57:34 +02:00
Michael Görner
4bee034768
Fixup: forward dataChanged() to QTreeView (#186) 2020-07-16 11:59:25 +02:00
v4hn
9dc43e49fe panel: start with all options expanded 2020-06-29 22:25:35 +02:00
v4hn
287287d23b panel: only local models can be edited 2020-06-29 22:25:35 +02:00
v4hn
da6d677991 add "show time column" to context menu 2020-06-29 22:25:35 +02:00
v4hn
6baf9f6a1b panel: optionally disable time column 2020-06-29 22:25:35 +02:00
v4hn
1b3f8fe8c3 panel: remove "interactive" add task from context menu
until there is anything reasonable to add. At the moment, there isn't.

This is one of the UI end-points for Robert's proposed drag&drop task system.
2020-06-29 22:25:35 +02:00
v4hn
95dad83126 panel: add margin above buttons 2020-06-29 22:25:35 +02:00
v4hn
7d510c79d3 solutions view: show the comment as tooltip
Makes much more sense than the internal id.
2020-06-29 22:25:35 +02:00
v4hn
853e7324e9 panel: have property-view occupy much less space by default
The initially more important part of the panel is clearly the task structure.
For longer tasks, the empty properties-view adds a scrollbar to the task when none would be needed.
2020-06-29 22:25:35 +02:00
v4hn
73fdca1708 panel: lower-case header texts
either all lower or all upper case.
2020-06-29 22:25:35 +02:00
v4hn
a380fea938 panel: unify alignment of header texts
User feedback said it's awkward and I quite agree. :)
2020-06-29 22:25:35 +02:00
v4hn
75bc6566f6 rework RViz panel
There's no need for individually resizable columns, but all numeric
content should autoresize and be visible all the time.

We will add an option to hide the time column in the future.

Remove intermediate AutoAdjustingTreeView layer to simplify code.
Resizing the columns did not work perfectly well before
and the auto_hide_cols_ feature was not really used.
2020-06-29 22:25:35 +02:00
v4hn
8faba159f9 clang-tidy: llvm-namespace-comment 2020-06-11 11:03:50 +02:00
v4hn
2153237643 clang-format: readability-identifier-naming
Probably the most invasive format patch, also changing some internal API.

I deliberately disabled ClassCase and MethodCase checks for the moment
to avoid public API changes in this patch set.
2020-06-11 11:03:50 +02:00
v4hn
b762079478 clang-tidy: readability-named-parameters 2020-06-11 11:03:50 +02:00
v4hn
5da2df4c61 clang-tidy: modernize-use-nullptr 2020-06-11 11:03:50 +02:00
v4hn
48f4c025ba clang-tidy: modernize-loop-convert 2020-06-11 11:03:50 +02:00
v4hn
3fe4436ad7 clang-tidy: modernize-use-override 2020-06-11 11:03:50 +02:00
v4hn
36166348bc clang-tidy: use using over typedef
$ run-clang-tidy.py -header-filter='.*' -checks='modernize-use-using' -fix

add .clang-tidy file
2020-06-11 11:03:50 +02:00
v4hn
9f07cf5e97 shorten task id if Task object has no name 2020-06-11 11:03:50 +02:00
v4hn
7270a658af connect to statistics *after* first description
This avoids the case where we would asynchronously receive the statistics
*before* the description and wouldn't know what to do with it.
2020-06-11 11:03:50 +02:00
v4hn
701589b651 simplify reading
my eyes hurt trying to cope with it.first->second .
2020-06-11 11:03:50 +02:00
Robert Haschke
9116e92d08 minor cleanup, fixing warnings, improving comments 2020-04-10 19:39:32 +02:00
v4hn
b6a5f89307 remove logical flow BOTH / simplify pruning
The PROPAGATE concept BOTH declared the stages *will* propagate solutions in
either direction. ANY, on the other hand, only means the propagation
direction is *not resolved yet* (but will be at planning time).

BOTH was originally described to support a more general control flow
than was eventually decided to support. The four exclusive Stage interfaces
CONNECT, PROPAGATE_FORWARDS, PROPAGATE_BACKWARDS, and GENERATOR
do not allow for BOTH as a valid setup anymore, unless you setup a very
convolved task like `Alternatives(GEN, PROP) - Alternatives(PROP, GEN)`
which would be very complex to inspect. The same functionality can still
be achieved more readable as `Alternatives(Seq(GEN, PROP), Seq(PROP, GEN))`.

The confusion between BOTH (propagator *will* send in both directions) and
ANY (propagator will send in *either* direction, decided during init) led
to a lot of confusion with users and was not fully accounted
throughout the pipeline.

Adjust tests.

Notice the difference between ANY (unresolved propagator) and UNKNOWN
(a container before introspecting its children). propagators still
report UNKNOWN as requiredInterface though to simplify control flow.

The simplification enables a much simpler linear inference of the connective
structure of a task, as the first interface direction is always given.

Additionally, unify the resource setup for static interfaces to run
in the constructor, and for dynamic initialization in `pruneInterface`,
getting rid of partial initializations in `init`.
2020-04-08 13:27:36 +02:00
Robert Haschke
f1acfa2f7e
Merge pull request #151: Various fixes 2020-04-03 11:58:19 +02:00
Robert Haschke
b26576dddc fix include order
As INCLUDE_DIRECTORIES of target_link_libraries always go AFTER those from target_include_directories,
we need to explicitly provide the include order for local targets.
2020-04-03 11:36:05 +02:00
v4hn
7cd82d5c04 resolve clang warnings & suggestions 2020-04-01 15:05:20 +02:00
Michael Görner
0eae0e652e
build tests using gmock via catkin_add_gmock (#148)
Otherwise these suddenly started to fail for me on Lunar Linux...
2020-03-20 20:33:33 +01:00
v4hn
194715abc6 limit float values in rviz to 4 digits
The previous implicit conversion leads to varying cell width.
2020-03-13 12:09:39 +01:00
Robert Haschke
5037bc77e7 Use public API only in visualization package 2020-03-03 17:57:06 +01:00
Robert Haschke
463486257b Merge #120: Add computation timing 2020-02-06 16:18:49 +01:00
Jafar Abdi
fa9b177575 transmit and display computation in rviz 2020-02-06 16:18:20 +01:00
Robert Haschke
ef6cb1a746 TaskPanel: execute selected solution 2020-01-11 09:15:11 +01:00
Michael Görner
f7b259259e Introduce clang-format (#102)
* fix catkin_lint issues
* introduce clang-format config and apply it
2019-07-18 11:04:35 +02:00
Michael Görner
1783587f41 add missing header (#100)
... for Qt 5.12.3
2019-07-12 17:25:10 +02:00
Robert Haschke
345c183d06 remove redundant nullptr checks before delete 2019-06-04 14:20:47 +02:00
Robert Haschke
95455c2a26 fix Task::operator=(Task&&)
To move a task instance to another one, it's not sufficient to swap all task members,
but we also need to adapt all back pointers, i.e. me_ and parent_ pointers of children,
to point to the (swapped) task instances.
2019-06-04 14:20:47 +02:00
Robert Haschke
11fb15fd0c fix clang-tidy warnings
- virtual functions used in constructor / destructor
- captured variable in lambda expression not used
- unhandled enums in switch
2019-05-03 01:53:17 +02:00
Robert Haschke
39427f89bf Merge branches 'fix-interface-deduction' (#84), 'compute-ik-default-timeout' (#80),
'fix-visualization' (#76), and master-improvements (#81)
2019-03-11 14:09:03 +01:00
Robert Haschke
2da9e0d722 rework solution msgs
- to allow solution wrappers (WrappedSolution, SolutionSequence)
  to transmit their comment and markers as well
- introduced new SolutionInfo.msg,
  which is the info common to solution wrappers and actual SubTrajectories
2019-02-12 13:57:12 +01:00
Robert Haschke
527ec8edaa correctly sort upstream_solutions_ in ComputeIK and GeneratePose
Reworked cost_queue to correctly sort pointer-like types.
Added unittests for new ValueOrPointeeLess<T> less operator, ordered<T>, and rviz cost ordering.
2019-02-12 03:05:36 +01:00
Robert Haschke
16e97f1caa TaskView: configure initial expansion state for tasks 2019-02-11 19:37:20 +01:00
Robert Haschke
1ce66c758b extensible TaskPanel
Provide TaskPanel::addSubPanel() to add new sub panels.
Each panel can be activated with an associated QToolButton.
Sub panels, derived from base class SubPanel, automatically load/save their config settings.
All settings are shown in GlobalSettingsWidget (renamed from TaskSettings).
2019-02-11 19:37:20 +01:00
Robert Haschke
6950cf2b8e create TaskPanel via rviz::VisualizationFrame::addPanelByName()
... ensuring that rviz also saves the panel's settings
2019-02-11 19:37:20 +01:00
Robert Haschke
e815fb41c2 RemoteTaskModel: all props read-only
... including ones registered in PropertyFactory
2019-02-10 06:21:51 +01:00
Robert Haschke
bb61513cb8 libyaml-based, incremental parsing of properties
... ensures display in document order
2019-02-10 06:21:51 +01:00
Robert Haschke
9810e3bb4b wip: understand event-based, incremental parsing with libyaml 2019-02-10 06:21:51 +01:00
Robert Haschke
e71376743c yamp-cpp parsing 2019-02-10 06:21:51 +01:00
Robert Haschke
20e951bf63 PropertyFactory::createDefault()
... creating a read-only rviz::Property from serialized mtc::Property value
2019-02-10 06:21:51 +01:00
Robert Haschke
4ca794cb86 unify property handling in LocalTaskModel and RemoteTaskModel 2019-02-10 06:21:51 +01:00
Robert Haschke
f9715f0c18 pass PlanningScene + DisplayContext to rviz::Property creation
... to allow properties to display scene-specific lists or create rviz markers
2019-01-18 00:11:17 +01:00
Robert Haschke
780e09145e stage-specific factories for PropertyTreeModel
To allow stages to display their properties in a custom fashion, e.g.
to show the end-effector marker for PoseStamped, we need to be able
to register stage-specific factories.
2019-01-18 00:11:17 +01:00
Robert Haschke
3f3c2f6bf9 Update MTC property on changes of rviz property 2019-01-18 00:11:17 +01:00
Robert Haschke
5b8d841094 RemoteTaskModel: show stage properties 2018-11-28 08:16:16 +01:00
Robert Haschke
6d81743a0b comments 2018-11-28 08:16:16 +01:00
Robert Haschke
aeaf497c75 propagate info about config changes to rviz 2018-10-20 23:33:54 +02:00
Robert Haschke
cb0ed11275 cleanup TaskPanel creation
automatically remove TaskPanel when last TaskDisplay is closed
2018-10-20 23:33:54 +02:00
Robert Haschke
a745f55ab7 fix compiler warnings in release mode 2018-10-17 01:55:28 +02:00
Robert Haschke
1787a66d37 fix compiler warnings 2018-10-16 23:14:58 +02:00
Robert Haschke
f2573e9bfd fix include order
Local headers should be preferred over those from underlay.
Consequently use target_include_directories() to properly define include order.
2018-09-25 13:30:53 +02:00
Robert Haschke
c2dd28abae rework storing of solutions
- solutions_, failures_ as SolutionBaseConstPtrs in StagePrivate
- replace processSolutions() / processFailures() by direct const-access to storage containers
- generic sendForward(), sendBackward(), spawn(), connect() methods in StagePrivate
- reuse StagePrivate's sendForward(), sendBackward(), spawn() in containers

- store created InterfaceStates in StagePrivate::states_
- Interface: ordered<InterfaceState*> (only store pointers)
  allows for common handling of states of valid and failure solutions

- remove additional state+solution storages
- containers: internal->external state mapping as InterfaceState* -> InterfaceState*
2018-05-30 21:02:50 +02:00
Robert Haschke
eb50aaed0e SolutionBase: rename 'name' to 'comment' 2018-05-30 20:25:42 +02:00
Robert Haschke
19fa7349d3 Task: only accept containers 2018-05-18 17:42:34 +02:00
Robert Haschke
320fe7e444 fix mem leaks 2018-04-27 12:06:14 +02:00
Robert Haschke
b316a2e9c4 allow marker pose updates during trajectory display
moved marker_visual_ from TaskDisplay to TaskSolutionVisualization
2018-03-26 00:14:32 +02:00
Robert Haschke
5a55a5949b Merge branches 'bug-fixes', 'gui' and 'pick-stage' 2018-03-24 07:32:20 +01:00
Robert Haschke
56c2ef3fbb save settings for solution sorting 2018-03-24 07:03:32 +01:00
Robert Haschke
2451d0c4d5 save panel settings 2018-03-23 17:25:49 +01:00
Robert Haschke
3d07e34522 highlight currently active solution part 2018-03-23 17:25:49 +01:00
Robert Haschke
0fd5f3c1b3 auto-expand newly inserted task-pipelines 2018-03-23 17:25:49 +01:00
Robert Haschke
3ce0bc7dee MetaTaskListModel: don't remove top-level items 2018-03-23 17:25:49 +01:00
janEbert
1f6bea9438 icons to visualize logic flow 2018-03-23 17:25:49 +01:00
Robert Haschke
3fe3034410 MarkerVisualization: improve comments
- renamed showMarkers() -> addMarkers()
- MarkerVisualizationProperty: renamed visible_markers_ -> hosted_markers_

Hosted markers are not neccessarily visible,
only if the corresponding namespace group is enabled.
2018-03-23 17:08:06 +01:00
Robert Haschke
ceaf896bf8 position scene node w.r.t. fixed frame 2018-03-23 11:22:23 +01:00
Robert Haschke
0494f1c93b [Tree|Flat]MergeProxyModel: cleanup index mapping when removing rows 2018-03-23 11:22:23 +01:00
Robert Haschke
3adc516037 fixed spurious rviz crash? 2018-02-25 20:28:13 +01:00
v4hn
4f2b38f02d add missing headers 2018-02-21 14:56:51 +01:00
Robert Haschke
8184156575 rviz plugin: fix segfault
Postpone setup of subscribers until robot model is successfully loaded.
Otherwise the scene used in task models is undefined.
2018-02-16 16:01:05 +01:00
Robert Haschke
050a4c3f86 basic framework to display stage properties 2018-02-12 23:39:07 +01:00
Robert Haschke
52904f65a2 bug fixes
- correctly keep display's Tasks property in sync with panel
  (insertion position didn't match to panel)
- disable actions depending on context
2018-02-12 23:37:30 +01:00
janEbert
193d3fef67 TaskPanel: separate widget classes
TaskPanel, TaskView, TaskSettings, ...
2018-02-12 23:37:30 +01:00
Robert Haschke
3b26d2777a RemoteTaskModel: insert solution also when received on solution topic 2018-02-12 22:36:58 +01:00
Robert Haschke
ca899d6a43 cleanup findById: fixup for 'allow handling of failures'
fixup for 014f291defb124a62bb66b78570356ee9e74a7ee
use SFINAE magic to distinguish both types of findById
unfortunately crashes gcc 5, clang works
2018-02-12 22:36:58 +01:00
Robert Haschke
1403fc9830 fixed some clang warnings 2018-02-12 22:36:12 +01:00
Robert Haschke
b60047318a code simplification
Usually, if we receive stage statistics there are some changes as well.
Hence, always emit notify signal in favour of complex change detection.
2018-02-12 22:36:12 +01:00
Robert Haschke
2184450bd6 count all failures for statistics 2018-02-12 22:36:12 +01:00
Robert Haschke
97bb6ef2c6 allow handling of failures
- store "failure" solutions to facilitate debugging
- Introspection assigns solution IDs as soon as they are created in a stage
  Thus, solution IDs represent their creation order.
  In contrast, the order of publishing (in StageStatistics) should
  represent the cost order.
- Storing failures is disabled if Introspection is not available.
2018-02-12 22:35:58 +01:00
Robert Haschke
5c1cad14df Merge branches 'fixes', 'wip-drag-n-drop', 'wip-ikstage' and 'wip-marker-vis'
resolved conflicts:
core/include/moveit/task_constructor/container.h
core/src/container.cpp
core/src/stages/generate_grasp_pose.cpp
visualization/motion_planning_tasks/src/task_display.cpp
visualization/motion_planning_tasks/src/task_panel_p.h
2018-02-04 21:36:01 +01:00
Robert Haschke
32660670a7 correctly pass on StageFactory 2018-02-04 21:30:25 +01:00
Robert Haschke
d9be19bbe8 re-enable drag-n-drop to edit task pipeline 2018-02-04 21:30:25 +01:00
Robert Haschke
faa7b38ff9 fix flaky "deletion" unittest 2018-02-04 20:59:16 +01:00
Robert Haschke
015dc2314a postpone panel instantiation
... to ensure that only a single instance is created
(something not really supported/intended by rviz)
2018-02-04 20:37:47 +01:00
Robert Haschke
5adac3f21f auto-load TaskPanel with TaskDisplay 2018-02-04 20:26:07 +01:00
Robert Haschke
6f95642a5a fix segfault 2018-02-04 09:01:40 +01:00
Robert Haschke
70fadbef11 fixed memory leak 2018-02-04 09:01:40 +01:00
Robert Haschke
32314d3532 consistently use double for costs 2018-02-04 09:01:40 +01:00
Robert Haschke
f8952bb712 introducing process_id
The task id was not unique enough to distinguish different tasks.
When a task publisher is killed and restarted, it usually comes up with
the same task id. However, visualization doesn't notice this change and
get confused / crashes when receiving task statistics and solutions.
2018-02-04 09:01:40 +01:00