Closed taichiH closed 5 years ago
Thanks 1) can you create test code for this issues? 2) can you check rospy/roscpp behavior?
2018年12月3日(月) 16:59 Taichi Higashide notifications@github.com:
Now, we cannot get a default boolean rosmsg value.
For example, if create test_msg.msg message in eus_test_msg package like below,
bool flag bool FLAG=1
I always get nil as a default value even though I set FLAG=1.
1.irteusgl$ ros::load-ros-manifest "eus_msg_test" t 2.irteusgl$ setq msg (instance eus_msg_test::test_msg :init)
<eus_msg_test::test_msg #X6396318>
3.irteusgl$ send msg :flag eus_msg_test::test_msg::flag nil
The cause of this problem is this line.
geneus/src/geneus/generate.py https://github.com/jsk-ros-pkg/geneus/blob/a97101f8ce8aa95bbaa9dee1586bcfccc9abf125/src/geneus/generate.py#L673
Line 673 in a97101f http:///jsk-ros-pkg/geneus/commit/a97101f8ce8aa95bbaa9dee1586bcfccc9abf125 s.write('(defconstant %s::%s::%s %s)'%(spec.package, spec.actual_name, c.name.upper(), "t" if c.val == "True" else "nil"))
This line's "True" should not be string value.
"t" if c.val == "True" else "nil"
after fix like below, I got correct boolean default value.
"t" if c.val == True else "nil"
You can view, comment on, or merge this pull request online at:
https://github.com/jsk-ros-pkg/geneus/pull/59 Commit Summary
- fix bug of write_constants
File Changes
- M src/geneus/generate.py https://github.com/jsk-ros-pkg/geneus/pull/59/files#diff-0 (2)
Patch Links:
- https://github.com/jsk-ros-pkg/geneus/pull/59.patch
- https://github.com/jsk-ros-pkg/geneus/pull/59.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jsk-ros-pkg/geneus/pull/59, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3EWjNXzMf_WVbZMSi-kdgyQyyvznks5u1NnugaJpZM4Y-Dlf .
--
◉ Kei Okada
@k-okada
1) I added test code.
2) I checked roscpp and rospy behavior, as a result, I correctly got True
from both.
@k-okada Maybe I got mistake. Is it correct to add geneus
test in https://github.com/jsk-ros-pkg/jsk_roseus/blob/master/roseus/test/test-geneus.l ?
@taichiH thank you for improvement. your patch has been merged via #62
Now, we cannot get a default boolean rosmsg value.
For example, if create
test_msg.msg
message ineus_test_msg
package like below,I always get
nil
as a default value even though I setFLAG=1
.The cause of this problem is this line. https://github.com/jsk-ros-pkg/geneus/blob/a97101f8ce8aa95bbaa9dee1586bcfccc9abf125/src/geneus/generate.py#L673
This line's "True" should not be string value.
after fix like below, I got correct boolean default value.