-
Notifications
You must be signed in to change notification settings - Fork 9
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
Restructure code to remove the need for multiple maps. #97
Restructure code to remove the need for multiple maps. #97
Conversation
@gavanderhoorn It was becoming a pain to manage all of the local mapping variable so I restructured the code to remove them. Take a look and let me know what you think. |
@Levi-Armstrong: thanks, this is definitely an improvement. It looks like you:
Then the responsibility of keeping the state of the tree widget in sync with the in-memory urdf model (ie: on change, add, delete, etc) is largely transferred to the This all on-top of the changes introduced by @swhart115 to support drag-and-drop of Is that a correct summary of the changes in this PR? |
#include "urdf_editor/link_property.h" | ||
#include "urdf_editor/joint_property.h" | ||
#include "urdf_editor/urdf_property_tree_link_item.h" | ||
#include "urdf_editor/urdf_property_tree_joint_item.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please change this to use angle brackets (<
and >
)?
@gavanderhoorn : Your summary is correct.
|
Major changes: - use signals and slots to broadcast and handle specific geometry type changes - LinkProperty is responsible for patching up urdf data structure - LinkGeometryProperty handles syncing sub-properties with new geom type Changes to URDFProperty have been reverted, as they are no longer needed.
Resources should really be referred to using a ROS package relative path, so a lookup and convesion step needs to be implemented.
I've just pushed the Milestone 1 merge candidate that includes PRs #70, #88 and #95, see m1_merge_candidate (diff here). As this PR contains quite few changes, I haven't yet merged it into |
@Levi-Armstrong: merging was easier than rebasing, but even that is proving a challenge. The refactor to |
Yea, I will look at it now. |
@gavanderhoorn, I believe everything has been merged correctly. The only item I was not certain on was the TF portion. To have everything work smoothly, I flowed all of the signals from the JointProperty to the URDFPropertyTree. This allowed the URDFProperty to monitor changes at a more detailed level allowing for the TF to only reside in the URDFProperty. Also this prevents the model from reloading when not necessary. |
I've merged this into m1_merge_candidate_v2 (diff). Thanks for taking the time to merge re: tf display + class: yes, that seems to not work 100% now: TF frames don't show up until one of the associated properties changes (ie: origin, link names, etc). If I understand things correctly, you removed the call to |
@gavanderhoorn, I have fixed the issues so TF will show up when a new model is loaded. Take a look and let me know what you think. |
If you want to test the |
@gavanderhoorn; I tried testing the the new branch but it crashes immediately. It looks like using pcl with c++11 may be the issue. |
Yes, I should've updated the installation/setup instructions: that branch needs to be build in release mode, otherwise it'll crash. It's indeed related to pcl and c++11. See #96. so for I might add a check in the |
Running just this branch gets me a |
Stack trace: Program received signal SIGSEGV, Segmentation fault.
QTreeWidgetItem::addChild (this=this@entry=0x22555e0, child=0x1a76f30)
at itemviews/qtreewidget.cpp:1886
1886 itemviews/qtreewidget.cpp: No such file or directory.
(gdb) bt
#0 QTreeWidgetItem::addChild (this=this@entry=0x22555e0, child=0x1a76f30)
at itemviews/qtreewidget.cpp:1886
#1 0x0000000000453b78 in urdf_editor::URDFPropertyTree::moveTreeChildren (
this=this@entry=0xb02680, parent=parent@entry=0x22554d0,
new_parent=new_parent@entry=0x22555e0)
at /home/user/cad2ros/src/cad-to-ros/urdf_editor/src/urdf_property_tree.cpp:414
#2 0x0000000000453fc8 in urdf_editor::URDFPropertyTree::removeLinkTreeItem (
this=this@entry=0xb02680, item=item@entry=0x22554d0)
at /home/user/cad2ros/src/cad-to-ros/urdf_editor/src/urdf_property_tree.cpp:306
#3 0x0000000000454741 in urdf_editor::URDFPropertyTree::on_removeActionTriggered (this=0xb02680)
at /home/user/cad2ros/src/cad-to-ros/urdf_editor/src/urdf_property_tree.cpp:472
#4 0x000000000042dc25 in urdf_editor::URDFPropertyTree::qt_static_metacall (
_o=0x22555e0, _c=27750192, _id=27750192, _a=0x21a7a90)
at /home/user/cad2ros/build/urdf_builder/include/urdf_editor/moc_urdf_property_tree.cxx:116
#5 0x00007ffff502b2da in QMetaObject::activate (sender=sender@entry=0xb2c570,
m=m@entry=0x7ffff5ff0de0 <QAction::staticMetaObject>,
local_signal_index=local_signal_index@entry=1,
argv=argv@entry=0x7fffffffb8c0) at kernel/qobject.cpp:3539
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) frame 1
#1 0x0000000000453b78 in urdf_editor::URDFPropertyTree::moveTreeChildren (
this=this@entry=0xb02680, parent=parent@entry=0x22554d0,
new_parent=new_parent@entry=0x22555e0)
at /home/user/cad2ros/src/cad-to-ros/urdf_editor/src/urdf_property_tree.cpp:414
414 new_parent->addChild(parent->takeChild(i)); |
@gavanderhoorn; I do not get that error when working of this branch but I do when using the _V2 branch. If you do a clean build does the error still occur? |
@gavanderhoorn; The issue occurs when compiling with c++11. I took the m1_merged_candidate_v2 and removed all of the c++11 items and everything works as expected. |
@Levi-Armstrong: I've cherry-picked 70b2b44 into the merge candidate v2 branch. |
All commits from this PR have been merged into m1_merge_candidate_v2, so I'll close this PR. Any additional issues with the merged functionality will be fixed in later issues/PRs. |
Thanks @Levi-Armstrong 💯. |
It was becoming very tedious to manage all of the local mapping so I restructure the code to remove all of the map simplifying the code and should make it easier to manage. This is to address issue #93 and includes pull request #87.