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

[cob_sick_s300] fix bug reading not all scan points #317

Merged
merged 8 commits into from
Mar 16, 2017
Merged

[cob_sick_s300] fix bug reading not all scan points #317

merged 8 commits into from
Mar 16, 2017

Conversation

mgruhler
Copy link
Contributor

@mgruhler mgruhler commented Feb 13, 2017

This PR fixes #256 and fixes #276 by (more) correctly implementing the size calculations acoording to the (updated) Sick telegram listing.

Tested with:

  • S300 Pro CMS (old protocol)
  • S300 Expert (compatability mode)
  • S300 Expert (new protocol)

This PR also comments out a warning about "old" parameter sets, as those parameter sets actually are buggy --> #318

@ipa-josh

@mgruhler mgruhler changed the title Fix/s300 missing values [WIP] Fix/s300 missing values Feb 14, 2017
@mgruhler
Copy link
Contributor Author

Testing with S300 Expert and the new protocol revealed some issues. Will reinvestigate this next week.

@mgruhler mgruhler changed the title [WIP] Fix/s300 missing values FIX bug in cob_sick_s300 reading not all scan points Feb 27, 2017
@mgruhler mgruhler changed the title FIX bug in cob_sick_s300 reading not all scan points [cob_sick_s300] fix bug reading not all scan points Feb 27, 2017
@mgruhler
Copy link
Contributor Author

@ipa-fxm @ipa-josh please review
@ipa-tif fyi

Copy link
Contributor

@fmessmer fmessmer left a comment

Choose a reason for hiding this comment

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

Other than the following comments, I can't say much about the protocol parsing...

Thus, the old Sick S300 Professional CMS as well as the new Sick S300 Expert are supported.

However, it does not cover the full functionality of the protocol:
- It only handle distance measurements properly
Copy link
Contributor

Choose a reason for hiding this comment

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

handle*s*

// Also, the size is reported as 16bit-words = 2 bytes...
//
// For the old protocol/compatability mode:
// "The telegram size is calculated ... starting with the ... 5. byte ... up to and including the ... CRC."
if(tc2_.protocol_version==0x102)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it make sense to have some kind of if(0x102)-elseif(0xXXX)-else(unsupported-protocol) construct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, probably yes? However, then we could just throw a warning and stop the node. There is no other way to do this. New protocol number is 0x103 (if the documentation is correct at least this once...).

Should I add this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, do we have a chance to "try" the protocols supported and then exit in case it is an unsupported protocol? How would we detect whether the protocol is not supported? Would "total message length" be an indicator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, total message length is not an indicator for the protocol. This changes depending on what you configure in the laser scanner itself.

I could throw an exception when there is an unsupported protocol, and "try" in the ROS (or the driver) part. What would you prefer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Detecting if the protocol is not supported could IMO only be done via checking the protocl number. However, this node could use some more error handling in this parser :-)

However, this would then also be another issue...

@@ -188,7 +188,7 @@ class NodeClass
}
else
{
ROS_WARN("No params for the Sick S300 fieldset were specified --> will using default, but it's deprecated now, please adjust parameters!!!");
//ROS_WARN("No params for the Sick S300 fieldset were specified --> will using default, but it's deprecated now, please adjust parameters!!!");
Copy link
Contributor

Choose a reason for hiding this comment

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

You know how I don't like commenting warnings...
In case it's just a deprecated parameter syntax, the user should see this warning and then after setting the parameter correctly this warning won't occur anymore...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do. However, this is a newly introduced parameter which should deprecate the old one. But this is buggy/not properly implemented and undocumented. See issue #318

The warning pops up every time you use a laserscanner without the new parameter layout and it took me quite some time to get the syntax right. It is also not yet used with cob (at least, I did not find anything).

Thus, instead of telling people they have a deprecated parameter set, we should first make sure this one is working correctly. Also, there is another issue with this parameter as it could leed to ambiguities. I'll gladly discuss this in person...

@mgruhler
Copy link
Contributor Author

mgruhler commented Mar 8, 2017

@ipa-fxm @ipa-josh @ipa-fmw ping

Copy link
Contributor

@floweisshardt floweisshardt left a comment

Choose a reason for hiding this comment

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

FR: OK

cannot say much about the implemented functionality. I'll open new issues for the comments from @ipa-fxm: https://github.com/ipa320/cob_driver/issues/325

@fmessmer
Copy link
Contributor

fmessmer commented Mar 9, 2017

I'll approve as soon as there are a little more details in #318

@fmessmer fmessmer merged commit b6a6025 into 4am-robotics:indigo_dev Mar 16, 2017
@mgruhler mgruhler deleted the fix/s300_missing_values branch May 17, 2017 13:50
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.

Lidar scan is warped [cob_sick_s300] missing distance values of sick s300 driver
4 participants