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

Improvements and fixes for various issues #13

Merged
merged 11 commits into from
Oct 8, 2020
Merged

Improvements and fixes for various issues #13

merged 11 commits into from
Oct 8, 2020

Conversation

rhaschke
Copy link
Member

@rhaschke rhaschke commented Oct 7, 2020

@rhaschke rhaschke requested a review from guihomework October 7, 2020 10:44
@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

Looks like the "Hide Small Values" property of WrenchVisuals was introduced in Melodic only. This explains that #7 suddenly popped up: The property wasn't correctly initialized in rviz.
I vote for dropping support for Kinetic.

@guihomework
Copy link

Looks like the "Hide Small Values" property of WrenchVisuals was introduced in Melodic only. This explains that #7 suddenly popped up: The property wasn't correctly initialized in rviz.
I vote for dropping support for Kinetic.

I did not test the new proposed solution yet, but how can the "hide small values" come into play (whether it is on or off) when all values have the same amount (I am publishing a 1.0 on all) ?

@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

How can the "hide small values" property come into play?

As I have written, the corresponding flag in rviz' WrenchVisual wasn't initialized and thus randomly true or false. If true, the arrows were hidden. What is considered small is hardcoded in rviz.

Looking at that code, I'm wondering why the vectors are hidden so early... Need to double-check.

@guihomework
Copy link

How can the "hide small values" property come into play?

As I have written, the corresponding flag in rviz' WrenchVisual wasn't initialized and thus randomly true or false. If true, the arrows were hidden. What is considered small is hardcoded in rviz.

So you mean that even with those "quite" large arrows they were hidden; Then the problem is indeed the decision of what is "small" that came into play.

regarding dropping support for kinetic. We have a melodic-branch, one can drop support of kinetic there I suppose.

@guihomework
Copy link

I confirm that changing the arrow width made the arrow visible even without this fix, so it is related to the way the hidesmallvalues is calculated. I will test this branch now

@rhaschke rhaschke force-pushed the fixups branch 4 times, most recently from 1368faa to ba30571 Compare October 7, 2020 15:45
@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

Travis is finally happy as well.

@@ -235,21 +240,18 @@ void TactileContactDisplay::update(float wall_dt, float ros_dt)

Display::update(wall_dt, ros_dt);

ros::Time now = ros::Time::now();
ros::Duration timeout(timeout_property_->getFloat());
ros::Time deadline = ros::Time::now() - ros::Duration(timeout_property_->getFloat());
Copy link

@guihomework guihomework Oct 7, 2020

Choose a reason for hiding this comment

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

I think this line is the cause of a crash when loading the plugin, and rosparam use_sim_time = true and no clock is published yet

terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range

previous to this fix the plugin did not crash
here is the trace of the crash

#0  0x00007ffff60a9f47 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff60ab8b1 in __GI_abort () at abort.c:79
#2  0x00007ffff6700957 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff6706ae6 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff6706b21 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff6706d54 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff3a77f8c in ros::normalizeSecNSecUnsigned(long&, long&) () at /opt/ros/melodic/lib/librostime.so
#7  0x00007ffff3a7d00c in ros::TimeBase<ros::Time, ros::Duration>::operator+(ros::Duration const&) const () at /opt/ros/melodic/lib/librostime.so
#8  0x00007ffff3a7d07f in ros::TimeBase<ros::Time, ros::Duration>::operator-(ros::Duration const&) const () at /opt/ros/melodic/lib/librostime.so
#9  0x00007fff93dc734a in rviz::tactile::TactileContactDisplay::update(float, float) () at /home/.../work/dev/catkin_ws_agni/devel/lib//librviz_tactile_plugins.so
#10 0x00007ffff7a7e156 in rviz::DisplayGroup::update(float, float) (this=0x5555558b5800, wall_dt=3.59348774, ros_dt=0)
    at /media/local/jenkins/jobs/rviz-agni-melodic-devel-ci-deploy-lsp-famula-nightly/workspace/src/rviz/display_group.cpp:240
#11 0x00007ffff7b48595 in rviz::VisualizationManager::onUpdate() (this=0x555556a461e0)
    at /media/local/jenkins/jobs/rviz-agni-melodic-devel-ci-deploy-lsp-famula-nightly/workspace/src/rviz/visualization_manager.cpp:361
#12 0x00007ffff6cb6555 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff6cc2fc7 in QTimer::timeout(QTimer::QPrivateSignal) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff6cc3328 in QTimer::timerEvent(QTimerEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff6cb707b in QObject::event(QEvent*) () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

Thanks for the intense testing. Probably sim_time starts at zero and subtracting the timeout duration then would result in a negative deadline. Would be great if you could provide a rosbag file to test this scenario.

@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

I fixed the offending commit, rewriting history. Could you give it another try?

@guihomework
Copy link

Thanks for the intense testing. Probably sim_time starts at zero and subtracting the timeout duration then would result in a negative deadline. Would be great if you could provide a rosbag file to test this scenario.

no rosbag needed, I thought this was clear. Just start a roscore, then set rosparam set /use_sim_time true
then start rviz, load a tactile_contact_state plugin, crash.

@guihomework
Copy link

I am wondering now that this PR introduces changes on the messages and timeouts and stuff like that, could we have information, about newly incoming data, but that is immediately outdated ?
I mean contact data that has a time inferior to (now - timeout) when it arrives ?

I ask because I fear I vaguely remember asking for such a feature in the past, and maybe the "no recent msg" was somehow there to indicate that. One should be sure before deleting it. More details follow.

what happens is that one thinks everything is ok in the contact_state plugin, but there is no display at all. I would not care about empty contact being received, or no new data when a certain contact was not refreshed for a while (which would be a "no recent msg" and I don't need that), but I care about the fact that a new data cannot be published because it is outdated before being even displayed and would like to be informed if possible.
Such an information would mean one has forgotten to set use sim time to true, and publish valid contact state in the past,
or if the processing of contact state is too slow for instance.

Another issues related to that, is in case the tf is also outdated, in this PR, the status messages stays at "not yet published...." when data is clearly published, but tf cannot be processed

Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
[ WARN] [1602094688.843153787]: TF_OLD_DATA ignoring data from the past for frame thumb_proximal_link at time 1.60209e+09 according to authority unknown_publisher

As sim time usually starts with zero, we cannot compute ros::Time::now - timeout,
which would be negative and throw an exception.
@guihomework
Copy link

should I test now again with my more advanced examples ?

@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

@guihomework, I performed a preliminary merge with melodic-devel to resolve the conflicts. If you give it the final approval, I will fast-forward melodic-devel to this PR branch.

@rhaschke
Copy link
Member Author

rhaschke commented Oct 7, 2020

@guihomework, you are asking a new feature (in #13 (comment)), now that this PR is close to ready. My suggestion is that we personally discuss what you want and implement the new feature next week. I need to focus on other things for the rest of the week.

@guihomework
Copy link

@guihomework, you are asking a new feature (in #13 (comment)), now that this PR is close to ready. My suggestion is that we personally discuss what you want and implement the new feature next week. I need to focus on other things for the rest of the week.

I had to write a comment in this PR before you merge in case the feature I asked in the past WAS the "status" you removed due to Gereon's request. Maybe adapting the deletion would have been necessary. I was not certain.

Just tell that what I am talking about is not affecting this PR, that it is ok to delete the "no recent msg" and we are good.
I was not really asking for more work, delaying the merge.
On the other hand this PR solves various issues at the same time, so maybe my idea as close to the work done in this PR.

Forget what I say. I will test now.

@rhaschke rhaschke merged commit 976921b into melodic-devel Oct 8, 2020
@rhaschke rhaschke deleted the fixups branch October 8, 2020 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants