ros_canopen
ros_canopen copied to clipboard
Support Boolean variables
Hi,
This PR adds support for Boolean (DataType=0x0001) variables. The new features are:
- DataType=0x0001 in EDS is parsed as C++ bool, regarding positive integer values of DefaultValue as "true"
- It's published as ROS std_msgs/Bool object.
Addresses https://github.com/ros-industrial/ros_canopen/issues/268
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 ?
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.
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 ?
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.
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?
Hi @lkm1321, were you able to test your PR with PDOs ?
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.