Skip to content

Commit c38e55f

Browse files
nls5260asaba96
authored andcommitted
Missing files & misc. fixes (#13)
* added back changes to README.md from previous commit * removed sim instructions from README.md * Added back fake_path.yaml * added new line to fake_path.yaml * Moved cont path launch * fixed origin initialization in continuous path * Enabled Lidar * Formatting * Fixed random issues * Added --local instructions * Updated instructions for new network * cleanup
1 parent 0b646f4 commit c38e55f

9 files changed

Lines changed: 59 additions & 24 deletions

File tree

‎README.md‎

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,47 @@
1-
Steps to use sim:
21

3-
1. Set ROBOT_IP to the desired target in robot.env
4-
2. Change noah to the target username everywhere in robot.sh
5-
3. ./robot.sh deploy
2+
## Deployment Scripts
63

7-
Periodically run
8-
docker system prune
9-
to delete old images if imageprune.py doesn't do it's job
4+
Code is deployed to the robot as a Docker image. Most actions are automated with the `robot.sh` script.
5+
6+
### Example Uses
7+
8+
#### Deploying
9+
```bash
10+
./robot.sh deploy
11+
```
12+
13+
This will copy and build your current workspace on the NUC. After building it will start execuiting on the NUC after stopping any previous code. A custom launch command can be given through command line arguments after `deploy`. After starting, your shell will show stdout/stderr from the NUC. Ctrl+Cing in your shell will not stop the process on the NUC.
14+
15+
#### Starting/Stopping
16+
```bash
17+
./robot.sh start
18+
./robot.sh stop
19+
```
20+
21+
These start/stop commands will start and stop the last image that has been deployed to the NUC. A custom launch command can be given through command line arguments after `start`. After starting, your shell will show stdout/stderr from the NUC. Ctrl+Cing in your shell will not stop the process on the NUC.
22+
23+
#### Viewing the console
24+
```bash
25+
./robot.sh watch
26+
```
27+
28+
"Watching" the console will watch the output of stdout/stderr, while also showing output from before you connected. Ctrl+Cing in your shell will not stop the process on the NUC.
29+
30+
### Configuration
31+
Deployment script configuration is set in `robot.env`. `ROBOT_IP` and `DEFAULT_LAUNCH` set the target system and default command to execute when starting an image. Other parameters like image/container name can be tweaked, but please don't change them on the competition robot without good reason.
32+
33+
### Help, I can't connect
34+
35+
Make sure you
36+
37+
- Connected to the robot_onboard WiFi network.
38+
- Have Docker installed on your machine (a local daemon does not need to be running)
39+
- Have your SSH key trusted by the NUC (see instructions in the computer-configuration folder)
40+
- Recieve a response with `ping 192.168.1.22`
41+
- If you get a request timeout after the NUC has been powered on for a minute, power cycle the NUC
42+
43+
### I want to deploy the stack locally (magellan_sim)
44+
Simply add the `--local` flag to your `robot.sh` command. Use the local flag with all other robot.sh functions as well.
45+
```bash
46+
./robot.sh --local deploy
47+
```

‎robot.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ case $1 in
5050
;;
5151

5252
shutdown)
53-
ssh ras@${ROBOT_IP} "sudo poweroff" &> /dev/nulli
53+
ssh ras@${ROBOT_IP} "sudo poweroff" &> /dev/null
5454
;;
5555

5656
shell)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<launch>
22
<include file="$(find magellan_core)/launch/passive.launch" />
33
<include file="$(find magellan_core)/launch/sim.launch" />
4-
</launch>
4+
</launch>
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<launch>
2-
<node pkg="magellan_vision" type="blobDetection_ROS.py" name="obstacle_avoidance_node"/>
2+
<node pkg="magellan_vision" type="blobDetection_ROS.py" name="obstacle_avoidance_node"/>
33
</launch>
4-

‎src/magellan_core/launch/passive.launch‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
<!--<include file="$(find magellan_core)/launch/gps.launch" />-->
77
<include file="$(find magellan_core)/launch/localization.launch" />
88
<!--<include file="$(find magellan_core)/launch/gps_localization.launch" />-->
9-
<!--<include file="$(find magellan_core)/launch/lidar.launch" />-->
9+
<include file="$(find magellan_core)/launch/lidar.launch" />
1010
<!--<include file="$(find magellan_core)/launch/new_navigation.launch" />-->
1111
<include file="$(find magellan_core)/launch/navigation.launch" />
1212
<!--<include file="$(find magellan_core)/launch/fake_path.launch" />-->
1313
<include file="$(find magellan_core)/launch/obstacle_avoidance.launch" />
14-
<include file="$(find magellan_core)/launch/continuous_path.launch" />
1514
<include file="$(find magellan_core)/launch/camera.launch" />
1615
</launch>

‎src/magellan_core/launch/robot.launch‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
<param name="port" value="/dev/ttyACM0" />
44
</node>
55
<include file="$(find magellan_core)/launch/passive.launch" />
6+
<include file="$(find magellan_core)/launch/continuous_path.launch" />
67
</launch>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<launch>
22
<node name="magellan_sim" pkg="magellan_sim" type="magellan_sim" />
3-
</launch>
3+
</launch>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
path: [ [0,0], [1, 0], [1, 1], [0, 1]]
2+
step_size: .1
3+
path_frame: odom
4+
odom_frame: odom

‎src/magellan_core/scripts/continuous_path.py‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self):
2121
self._frame_id = 'odom'
2222
self._odom_frame_id = 'odom'
2323
self._publisher = rospy.Publisher('/path', Path, queue_size=5)
24-
self.raw_path_sub = rospy.Subscriber('/noah/raw_path', Point, self.raw_path_callback)
24+
self.raw_path_sub = rospy.Subscriber('/continuous_path', Point, self.raw_path_callback)
2525

2626
def raw_path_callback(self, data):
2727
now = rospy.Time.now()
@@ -73,16 +73,10 @@ def publish_path(self):
7373
rospy.init_node('continuous_path')
7474

7575
node = ContinuousPathNode()
76-
debug_raw_path_pub = rospy.Publisher('/noah/raw_path', Point, queue_size=5)
77-
78-
debug_point = Point()
79-
debug_tick = 0
80-
rospy.sleep(2)
8176

8277
# initialize first point on path to origin
83-
debug_point.x = 0
84-
debug_point.y = 0
85-
debug_point.z = 0
86-
debug_raw_path_pub.publish(debug_point)
78+
origin = Point()
79+
node.raw_path_callback(origin)
80+
8781
while not rospy.is_shutdown():
8882
rospy.spin()

0 commit comments

Comments
 (0)