@@ -7,7 +7,7 @@ accomplishment because learning to use ROS is no easy feat.
7
7
In this document, we'll present some ideas on how you could improve upon this
8
8
controller in order to expand on your ROS knowledge. We'll also give you some
9
9
tips and insight into additional topics you may encounter while working on your
10
- own improvments .
10
+ improvements .
11
11
12
12
## Ideas for Improvement
13
13
Feel free to use some of these ideas in the list, or go off and do your own
@@ -21,7 +21,7 @@ snake if it is detecting a collision.
21
21
22
22
You could also remove the goal relay completely and design your own waypoint
23
23
controller that uses an graph based planning algorithm. For example, grassfire,
24
- Dijkstra, or A star algorithms could all work.
24
+ Dijkstra, or A* (pronouced "A star") algorithms could all work.
25
25
26
26
If you want to get really fancy, you could consider the fact that the snake is
27
27
going to move as you execute the motion plan, so it may be acceptible to
@@ -39,8 +39,9 @@ and position controller that re-routes the snake to a safe path. You could
39
39
also remove it completely and build it right into a fancier waypoint controller.
40
40
41
41
This could be built in addition to the self avoidance system using some sort of
42
- planning algorithm that looks past reaching the next goal. For example RRT could
43
- be used to find a safe path to the goal and an arbitray secondary location.
42
+ planning algorithm that looks past reaching the next goal. For example Rapidly
43
+ Exploring Random Trees (RRT) could be used to find a safe path to the goal and
44
+ an arbitray secondary location nearby.
44
45
45
46
### Machine Learning
46
47
If you have experience with machine learning, you can probably apply it to this
@@ -96,7 +97,7 @@ For Python, follow the [PEP 8 guidelines](https://www.python.org/dev/peps/pep-00
96
97
- classes: ` PascalCase `
97
98
- variables: ` snake_case `
98
99
- "private" variables: ` _snake_case_with_leading_underscore `
99
- - "constant" variables: ` CAPITALIZED `
100
+ - "constant" variables: ` CAPITALIZED_WITH_UNDERSCORES `
100
101
- functions: ` snake_case `
101
102
- "private" functions: ` _snake_case_with_leading_underscore `
102
103
@@ -105,7 +106,7 @@ Generally, you want to use a ROS message type that is intended for the
105
106
application you have in mind. For example, the ` Vector3 ` message and the ` Point `
106
107
message both have three fields, ` x ` , ` y ` , and ` z ` . However, ` Vector3 ` is
107
108
designed to represent vectors in 3D space, while ` Point ` is designed to
108
- represent a point in 3D space.
109
+ represent points in 3D space.
109
110
110
111
Another bad thing is to use a message and use the fields for different purposes
111
112
than intended. For example, ROS has a ` Quaternion ` message, but no standard
@@ -170,8 +171,10 @@ def callback_two(self, msg):
170
171
self .lock.release()
171
172
```
172
173
173
- Locks are provided through the ` threading ` library, and you can read more about
174
- them [ online] ( https://docs.python.org/2/library/threading.html#lock-objects ) .
174
+ This works because one callback can't acquire the lock until the other has
175
+ released it. It is a blocking call by default. Locks are provided through the
176
+ ` threading ` library, and you can read more about them
177
+ [ online] ( https://docs.python.org/2/library/threading.html#lock-objects ) .
175
178
176
179
#### Atomic Operations
177
180
This is a more advanced concept, but it can make things a little bit simpler if
@@ -200,24 +203,36 @@ There are going to be many times where ROS wants to make you slam your head into
200
203
Luckily there are tools to reduce that frustration and help spot issues.
201
204
202
205
This is a short list of the many options avaliable:
206
+
203
207
- [ rqt_graph] ( http://wiki.ros.org/rqt_graph ) : This ROS package allows users to
204
208
visualize the ROS computation graph. In other words, you can see what nodes
205
209
are active as well as
206
210
how nodes are communicating. Here is an example of a graph:
207
211
![ rqt graph example] ( images/rqt-example.png )
208
- - [ roswtf] ( http://wiki.ros.org/roswtf ) : This ROS package is a general
209
- debugging tool that finds issues by searching your workspace. Additionally
210
- it has a funny name.
212
+
213
+ - [ roswtf] ( http://wiki.ros.org/roswtf ) : This ROS package is an automated
214
+ debugging tool that finds issues by searching your workspace and graph. It can
215
+ find things like improperly set up packages and nodes with unconnected topics.
216
+ Additionally it has a fun name.
217
+
211
218
- [ rostopic] ( http://wiki.ros.org/rostopic ) : This command-line tool can be used
212
- in debugging nodes. The two commands you might find most useful are
213
- ` echo ` and ` pub ` , which help in manually receiving and sending messages. This
214
- is espcially helpful for testing or when running nodes independently.
219
+ in debugging nodes by the messages sent on connected topics. The main commands
220
+ you might find most useful are ` list ` , ` echo ` and ` pub ` . ` list ` will list all
221
+ active topics on the ROS graph. ` echo ` will let you monitor a topic live on the
222
+ commandline. ` pub ` will let you send messages via the command line. This tool is
223
+ espcially helpful for testing or when running nodes independently.
224
+
215
225
- [ rosnode] ( http://wiki.ros.org/rosnode ) : This is another useful command-line
216
- tool for debugging nodes. You can use ` info ` to print out various information
217
- about a given node.
226
+ tool for debugging nodes. You can use ` list ` to see all active nodes, then
227
+ ` info ` to print out various information about a given node.
228
+
218
229
- [ Python Specific Debugger (PDB)] ( https://docs.python.org/3/library/pdb.html ) :
219
- This is a tool built to help debug python applications. It was used heavily in
220
- making the ` snakesim ` package.
230
+ This is a tool built to help debug python applications. It has nothing to do
231
+ with ROS. It has a bit of a learning curve, but it was used heavily in making
232
+ the ` snakesim ` package. It may be worth using if you think you have issues
233
+ inside of a node that you can't debug by looking at ROS messages going in and
234
+ out. It will allow you to step through your code using breakpoints, and monitor
235
+ the value of variables as you do so.
221
236
222
237
## Additional Resources and Getting Help
223
238
If you're part of the Autonomous Robotics Club of Purdue, you can post questions
@@ -243,6 +258,6 @@ tutorial to add to this package, lets us know.
243
258
244
259
If you're outside of the club and found this useful, please let us know. You can
245
260
give the repo some stars on [ GitHub] ( https://github.com/purdue-arc/arc_tutorials ) .
246
- You can also create Issues for any problems you found, or open up a PR if you
247
- have a fix. If you want to get in contact with the maintainer, send us an email
248
- through [ autonomy@purdue.edu ] ( mailto:autonomy@purdue.edu ) .
261
+ You can also create GitHub Issues for any problems you found, or open up a PR if
262
+ you have a fix. If you want to get in contact with the maintainer, send us an
263
+ email through [ autonomy@purdue.edu ] ( mailto:autonomy@purdue.edu ) .
0 commit comments