tork-a / dynpick_driver

ROS driver for Wacohtech force sensor
5 stars 17 forks source link

added partial decoding of serial communication to main.cpp #1

Closed Qualot closed 9 years ago

Qualot commented 9 years ago

modified from read(...FULL LENGH) to read(...PARTIAL) to read serial data smoothly.

k-okada commented 9 years ago

please separate PR into two parts, one is just to change coding style, and the others is to change code logic.

Qualot commented 9 years ago

Thanks, Okada-sensei,

Actually, I do not distinguish coding style and logic. Could you tell me that or show me an example or reference?

Thank you,

                                    Shinsuke

2014-12-20 1:37 GMT+09:00 Kei Okada notifications@github.com:

please separate PR into two parts, one is just to change coding style, and the others is to change code logic.

— Reply to this email directly or view it on GitHub https://github.com/tork-a/dynpick_driver/pull/1#issuecomment-67662019.


中島慎介 Nakashima Shinsuke

東京大学 情報理工学系研究科 知能機械情報学専攻 情報システム工学研究室 Graduate School of Information Science and Technology The University of Tokyo Mechano-Informatics JSK Laboratory

7-3-1 Hongo, Bunkyo-ku, Tokyo 113-8656 Japan Tel: 03-5841-7416 / Fax: 03-5841-6285 Email: snakashima@jsk.imi.i.u-tokyo.ac.jp


130s commented 9 years ago

@Qualot For the case like you who's attentive to coding style, I recommend to separate commits like in the following order; (1st commit) edit the style, (2nd and later) add the actual change you'd like.

Qualot commented 9 years ago

how about this pull request?

130s commented 9 years ago

+1

k-okada commented 9 years ago

ok, i created new PR #7 for typo and #8, #9 for read data

8 and #9 is just a different implementation, so please choose one which you like, I haven't tested on real hardware, so please confirm this solves you problem > @Qualot

130s commented 9 years ago

I confirmed both #8 and #9 "runs" with the device. Since I still don't understand the problem this PR tries to address, I have no idea to pick either PR. @Qualot ?

(If I'm asked, I can only follow the general rule of thumb to avoid using goto so pick #9 that keeps away from goto. But I'm no C expert).

k-okada commented 9 years ago

this is very common case when reading fixed byte from input stream, the read stream can take a number of bytes to read in its arguments, but it did not grantee that the read reads the given bytes, it reads possible bytes and returns the byte. read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf.

130s commented 9 years ago

Please choose either #8 or #9. I've tested with the real device, both ran but had no idea how I can verify the accuracy.

k-okada commented 9 years ago

This is just a code style difference, please choose either you prefer.

◉ Kei Okada

On Mon, Mar 23, 2015 at 12:24 AM, Isaac I.Y. Saito <notifications@github.com

wrote:

Please choose either #8 https://github.com/tork-a/dynpick_driver/pull/8 or #9 https://github.com/tork-a/dynpick_driver/pull/9. I've tested with the real device, both ran but had no idea how I can verify the accuracy.

— Reply to this email directly or view it on GitHub https://github.com/tork-a/dynpick_driver/pull/1#issuecomment-84630959.