-
Notifications
You must be signed in to change notification settings - Fork 1
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
Comments and changes to DVL files #14
Open
EdwinTran
wants to merge
2
commits into
main
Choose a base branch
from
SensorDummyData
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 21 additions & 21 deletions
42
..._and_controls/src/teledyne_dvl/readme.txt → ...d_controls/src/teledyne_dvl/OLDreadme.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
Testing the DVL | ||
CR1 | ||
ck | ||
PS0 | ||
Deployment test | ||
pa | ||
so far | ||
pa test passed | ||
connection - passes, finnicky | ||
dvl_test.py | ||
has coded the pt5 and pa tests | ||
no changes to any data | ||
unsure what the problems are | ||
Testing the DVL | ||
CR1 | ||
ck | ||
PS0 | ||
|
||
|
||
Deployment test | ||
pa | ||
|
||
|
||
so far | ||
pa test passed | ||
connection - passes, finnicky | ||
|
||
|
||
|
||
dvl_test.py | ||
has coded the pt5 and pa tests | ||
no changes to any data | ||
unsure what the problems are | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Teledyne DVL | ||
This folder contains files and code related to the Teledyne Pathfinder DVL. | ||
|
||
The DVL will be connected to the computer and will directly communicate with the computer equivalent. | ||
|
||
`dvl_dummy.ino` is currently used to create fake dummy data to be send using an arduino. `dvl_dummy.ino` is used to create and send dummy data using `serial`. If using `dvl_dummy.ino` to create fake dummy data then change the argument in `main.py` to `/dev/ttyACM0` otherwise keep as `COM4` to communicate with the DVL. | ||
|
||
`dvl_driver.py` has yet to be tested with the Pathfinder DVL. Currently used to receive dummy data and print it out. | ||
|
||
The `main.py` file is to be used to run start things up. | ||
Change the port in `main.py` if necessary if you cannot connect to the current port. | ||
|
||
In the `main.py` file import either dvl_driver.py as DVL or dvl_test.py as DVL for testing purposes. | ||
|
||
## Getting Started | ||
### Requirements: | ||
- Python 2.7 | ||
- Ros Melodic | ||
- Ubuntu 18.04 | ||
- Possibly [rosserial](http://wiki.ros.org/rosserial_arduino/Tutorials/Arduino%20IDE%20Setup) | ||
|
||
### To run the code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will run dvl as it's own package, so there should be a different rosrun command for opening this node. We can look into it tomorrow |
||
- Go to root folder of project | ||
- `catkin_make` | ||
- `source devel/setup.bash` | ||
- `rosrun sensing_and_actuation main.py` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
sensors_and_controls/src/teledyne_dvl/dvl_dummy/dvl_dummy.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* rosserial Publishing DVL sensor data | ||
*/ | ||
|
||
#include <ros.h> | ||
// INCLUDE NECESSARY LIBRARY FOR SENSORS | ||
|
||
int xvel = 0; | ||
int yvel = 0; | ||
int zvel = 0; | ||
int xpos = 0; | ||
int ypos = 0; | ||
int zpos = 0; | ||
int yaw = 0; | ||
int pitch = 0; | ||
int roll = 0; | ||
int depth = 0; | ||
String s = ","; | ||
|
||
void setup() { | ||
//SHOULD INITIALIZE SENSORS BELOW IN THE SETUP | ||
//Set serial baudrate to the same in dvl_driver.py | ||
Serial.begin(115200); | ||
} | ||
|
||
void loop() { | ||
//USE LOOP TO CONSTANTLY GET SENSOR DATA AND PUBLISH IT | ||
//SHOULD HAVE A DELAY AS TO HOW OFTEN IT SHOULD GET DATA | ||
|
||
|
||
|
||
//Serial printing to computer. Currently printing DUMMY DATA | ||
//Printing dummy data in the form of xpos, ypos, zpos, yaw, pitch, roll, depth | ||
Serial.println(xvel + s + yvel + s + zvel + s + xpos + s + ypos + s + zpos + s + yaw + s + pitch + s + roll); | ||
|
||
//Randomly adding | ||
xvel = xvel + random(-1, 2); | ||
yvel = yvel + random(-1, 2); | ||
zvel = zvel + random(-1, 2); | ||
xpos = xpos + random(-5, 6); | ||
ypos = ypos + random(-5, 6); | ||
zpos = zpos + random(-5, 6); | ||
yaw = yaw + random(-3, 4); | ||
pitch = pitch + random(-3, 4); | ||
roll = roll + random(-3, 4); | ||
|
||
delay(3000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
from dvl_driver import DVL | ||
import matplotlib.pyplot as plt | ||
from matplotlib import style | ||
|
||
|
||
def main(): | ||
# style.use('fivethirtyeight') | ||
# | ||
# fig = plt.figure() | ||
# ax1 = fig.add_subplot(1,1,1) | ||
|
||
|
||
dvl = DVL("Com4") | ||
dvl.start() | ||
|
||
|
||
|
||
while True: | ||
if dvl.has_data(): | ||
data = dvl.get_data() | ||
print(str(data)) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() | ||
#! /usr/bin/env python | ||
import rospy | ||
|
||
|
||
from dvl_driver import DVL | ||
import matplotlib.pyplot as plt | ||
from matplotlib import style | ||
|
||
|
||
def main(): | ||
style.use('fivethirtyeight') | ||
|
||
fig = plt.figure() | ||
ax1 = fig.add_subplot(1,1,1) | ||
|
||
# COM4 being the port which connects from the computer to DVL. | ||
dvl = DVL("COM4") | ||
dvl.start() | ||
|
||
|
||
|
||
while True: | ||
if dvl.has_data(): | ||
data = dvl.get_data() | ||
print(str(data)) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we need these requirements here, as we have them in the main readme