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

ping device simulation #33

Merged
merged 1 commit into from
Jan 29, 2019
Merged

ping device simulation #33

merged 1 commit into from
Jan 29, 2019

Conversation

jaxxzer
Copy link
Member

@jaxxzer jaxxzer commented Jan 23, 2019

No description provided.

@jaxxzer jaxxzer changed the base branch from pingsim to master January 23, 2019 23:37
@jaxxzer jaxxzer force-pushed the pingsim branch 2 times, most recently from 866df1f to 96f4bed Compare January 25, 2019 18:15
@jaxxzer jaxxzer changed the title [WIP] ping device simulation ping device simulation Jan 25, 2019
Copy link
Member

@Williangalvani Williangalvani left a comment

Choose a reason for hiding this comment

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

Looks good!
Just a few details.

brping/ping1d-simulation.py Outdated Show resolved Hide resolved
brping/ping1d-simulation.py Outdated Show resolved Hide resolved
brping/ping1d-simulation.py Outdated Show resolved Hide resolved
brping/ping1d-simulation.py Outdated Show resolved Hide resolved
@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

@Williangalvani done

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

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

Also, missing executable permission.

brping/ping1d-simulation.py Show resolved Hide resolved
@patrickelectric
Copy link
Member

 ✘ patrick@pichau  ~/git/blue/ping-python/brping  ➦ 979e500 ●  pip install bluerobotics-ping --user
Requirement already satisfied: bluerobotics-ping in /home/patrick/.local/lib/python3.7/site-packages (0.0.2)
Requirement already satisfied: pyserial in /usr/lib/python3.7/site-packages (from bluerobotics-ping) (3.4)
 patrick@pichau  ~/git/blue/ping-python/brping  ➦ 979e500 ●  python -m ping1d-simulation 
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/patrick/git/blue/ping-python/brping/ping1d-simulation.py", line 162, in <module>
    sim.sendMessage(PING1D_PROFILE)
  File "/home/patrick/git/blue/ping-python/brping/ping1d-simulation.py", line 76, in sendMessage
    msg.pack_msg_data()
  File "/home/patrick/.local/lib/python3.7/site-packages/brping/pingmessage.py", line 471, in pack_msg_data
    self.msg_data = bytearray(struct.pack(msg_format, *values))
struct.error: pack expected 6 items for packing (got 15)
 ✘ patrick@pichau  ~/git/blue/ping-python/brping  ➦ 979e500 ●  

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

@patrickelectric use python3

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

Also, missing executable permission.

$ ls -l brping/
total 108
-rw-r--r-- 1 jack jack    89 Jan 19 12:31 __init__.py
-rw-r--r-- 1 jack jack   211 Jan 24 15:51 __init__.pyc
-rw-r--r-- 1 jack jack 32470 Jan 25 12:22 ping1d.py
-rw-r--r-- 1 jack jack 13607 Jan 24 15:51 ping1d.pyc
-rw-r--r-- 1 jack jack  5975 Jan 28 14:29 ping1d-simulation.py
-rw-r--r-- 1 jack jack 22945 Jan 25 17:19 pingmessage.py
-rw-r--r-- 1 jack jack 13322 Jan 24 15:51 pingmessage.pyc
-rw-r--r-- 1 jack jack  3413 Jan 19 12:31 pingproxy.py

The permission is the same as everything else.

@patrickelectric
Copy link
Member

patrickelectric commented Jan 28, 2019

@jaxxzer I'm using.
But ping1d-simulation.py is a program by itself, this one should have +x now ?
@Williangalvani

@patrickelectric
Copy link
Member

@jaxxzer Same problem with a fresh arch installation.

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

@patrickelectric This requires bluerobotics/ping-protocol#118 merge

@patrickelectric
Copy link
Member

Ok, this should be tagged in the PR.

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

I forgot. Now it is.

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

But ping1d-simulation.py is a program by itself, this one should have +x now ?

#43

@@ -0,0 +1,165 @@
#!/usr/bin/python -u
Copy link
Member

@patrickelectric patrickelectric Jan 28, 2019

Choose a reason for hiding this comment

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

You should use env and not python directly.

Copy link
Member

Choose a reason for hiding this comment

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

Python3 only

#!/usr/bin/env python3

or
Python2 only

#!/usr/bin/env python2

or
Both python versions

#!/usr/bin/env python

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

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

shebang should use /usr/bin/env and not python directly

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

shebang should use /usr/bin/env and not python directly

This matches the case in the rest of the repository.
#44

@jaxxzer
Copy link
Member Author

jaxxzer commented Jan 28, 2019

shebang should use /usr/bin/env and not python directly

done

@jaxxzer jaxxzer merged commit 3607685 into bluerobotics:master Jan 29, 2019
@jaxxzer jaxxzer deleted the pingsim branch January 29, 2019 00:57
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.

None yet

3 participants