Skip to content

Commit

Permalink
added pose support in run file
Browse files Browse the repository at this point in the history
  • Loading branch information
GarrettChristian committed Apr 21, 2021
1 parent d53b4a9 commit f6205b5
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 8 deletions.
6 changes: 5 additions & 1 deletion cart_endpoints/launch/hardware_interface.launch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
</group>

<group>
<node name="pointcloud_to_laserscan_node" pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" args="cloud_in:=/velodyne_points scan:=/pcd_to_scan" output="screen" />
<node name="pointcloud_to_laserscan_node" pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" args="cloud_in:=/velodyne_points scan:=/pcd_to_scan" output="screen">
<param name="min_height" type="double" value="-1.0" />
<param name="max_height" type="double" value="0" />
<param name="range_min" type="double" value="0.8" />
</node>
</group>


Expand Down
1 change: 0 additions & 1 deletion cart_planning/scripts/local_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def update(self, state, a, delta):
# Check if any node wants us to stop

# Slow, normal stop
print(self.stop_requests)
if any([x[0] for x in self.stop_requests.values()]):
msg.vel = 0

Expand Down
40 changes: 36 additions & 4 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/bin/bash

# Check for fake pose flag
fake_pose_flag=''

print_usage() {
printf "Usage: -p activates fake_pose\n"
}

while getopts 'p' flag; do
case "${flag}" in
p) fake_pose_flag='true' ;;
*) print_usage
exit 1 ;;
esac
done

# Start everything

sudo modprobe -r uvcvideo
echo "Configuring Velodyne..."
./velodyne_setup.sh
Expand All @@ -9,11 +27,25 @@ sleep 2
echo "Launching Navigation Code..."
gnome-terminal --tab -e 'sh -c "roslaunch cart_control navigation.launch obstacle_detection:=true; exec bash"'
sleep 5
echo "Starting pose tracking server..."
gnome-terminal --tab -e 'sh -c "cd ~; cd Desktop/pose-tracking; npm start; exec bash"'
# echo "Starting pose tracking server..."
# gnome-terminal --tab -e 'sh -c "cd ~; cd Desktop/pose-tracking; npm start; exec bash"'
sleep 5
echo "Starting local server..."
gnome-terminal --tab -e 'sh -c "cd ~; cd Desktop/jakart-local-server; HTTPS=true npm start; exec bash"'
# gnome-terminal --tab -e 'sh -c "cd ~; cd Desktop/jakart-local-server; HTTPS=true npm start; exec bash"'
echo "Starting UI"
gnome-terminal --tab -e 'sh -c "cd ~; cd Desktop/jakart-cart-ui; HTTPS=true npm start; exec bash"'
# gnome-terminal --tab -e 'sh -c "cd ~; cd Desktop/jakart-cart-ui; HTTPS=true npm start; exec bash"'

# Pose tracking
if [ -z "$fake_pose_flag" ]
then
# launch pose
echo "Starting pose tracking"
gnome-terminal --tab -e 'roslaunch zed_wrapper zed.launch'
sleep 5
gnome-terminal --tab -e 'python ../jacart-zed/pose/pose_tracking.py'

else
# launch fake pose
echo "Starting fake pose tracking"
gnome-terminal --tab -e 'python ../jacart-zed/pose/fake_pose_tracking.py'
fi
8 changes: 6 additions & 2 deletions velodyne_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ nmcli radio wifi off

echo "Assigning IP to Port"

sudo ifconfig eno1 192.168.3.100
sudo ifconfig enp0s31f6 192.168.3.100

echo "Adding static route to LIDAR IP"

sudo route add 192.168.1.201 eno1
sudo route add 192.168.1.201 enp0s31f6

echo "Try running the velodyne manager now"

sleep 5

nmcli radio wifi on
17 changes: 17 additions & 0 deletions velodyne_setup.sh.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo "Running Velodyne Setup Script"

echo "Shutting Down WiFi"

nmcli radio wifi off

echo "Assigning IP to Port"

sudo ifconfig eno1 192.168.3.100

echo "Adding static route to LIDAR IP"

sudo route add 192.168.1.201 eno1

echo "Try running the velodyne manager now"
17 changes: 17 additions & 0 deletions velodyne_setup_tmp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo "Running Velodyne Setup Script"

echo "Shutting Down WiFi"

nmcli radio wifi off

echo "Assigning IP to Port"

sudo ifconfig enp0s31f6 192.168.3.100

echo "Adding static route to LIDAR IP"

sudo route add 192.168.1.201 enp0s31f6

echo "Try running the velodyne manager now"

0 comments on commit f6205b5

Please sign in to comment.