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

Support Boolean variables #403

Open
wants to merge 2 commits into
base: melodic-devel
Choose a base branch
from

Conversation

lkm1321
Copy link

@lkm1321 lkm1321 commented Aug 31, 2020

Hi,

This PR adds support for Boolean (DataType=0x0001) variables. The new features are:

  1. DataType=0x0001 in EDS is parsed as C++ bool, regarding positive integer values of DefaultValue as "true"
  2. It's published as ROS std_msgs/Bool object.

Addresses #268

@mathias-luedtke mathias-luedtke self-requested a review September 4, 2020 11:13
@Roboprotos
Copy link

Hi,
Thanks for proposing this PR, this feature would be really helpful.
Since it has passed all the checks, would it be possible to have it merged with the melodic-devel branch ?

@mathias-luedtke
Copy link
Member

This fix look okay, but I am unsure about PDO support. canopen_master does not support bit-wise access (granularity 1).
Unfortunately, I was never able to test this, because none of our devices support boolean objects.

@Roboprotos
Copy link

I see, I was mainly interested in the DCF parser, to be able to parse boolean datatype from some manufacturer specific objects that can't be mapped to PDO.

I agree PDO support should be checked before merging, or if canopen_master doesn't support granularity 1, do you think the parser could just reject files which have a mappable boolean object ?

@mathias-luedtke
Copy link
Member

do you think the parser could just reject files which have a mappable boolean object ?

I think it should be possible to fail the init service, if a boolean gets mapped.

@mathias-luedtke mathias-luedtke self-assigned this Jun 21, 2021
@lkm1321
Copy link
Author

lkm1321 commented Jun 21, 2021

Hi guys, thanks for the interest. I do have a device with Boolean variables. I checked that parsing and SDOs are okay, but not PDOs. I'm happy to test whether PDO works. Would that help with having this merged?

@Roboprotos
Copy link

Hi @lkm1321, were you able to test your PR with PDOs ?

@lkm1321
Copy link
Author

lkm1321 commented Dec 5, 2021

Hi @Roboprotos, I did a quick test of this feature with our device (Roboteq RGBL1896) but doesn't seem to work correctly. SDO just seems to read 0 even though the underlying value should be 1. I'm not sure if the fault is in ros_canopen or in the device's firmware, and I'd need to look at cansniffer output to debug, but I'll be away from lab until February so it'll be some time before I do any debugging. I'll update if any developments before that.

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.

3 participants