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

Nand launch file #57

Merged
merged 10 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Then `$ cd RoboBuggy2`
- Go to docker container
`$ docker_exec`
- Open foxglove and do local connection to “ws://192.168.1.217/8765”
- Roslauch in docker container by `$ roslaunch buggy main.launch`
- Roslauch in docker container by `$ roslaunch buggy sc-main.launch` (or `$ roslaunch buggy nand-main.launch` for NAND)
(wait until no longer prints “waiting for covariance to be better”)

When shutting down the buggy:
Expand Down
25 changes: 25 additions & 0 deletions rb_ws/src/buggy/launch/nand-main.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- roslaunch buggy main.launch -->

<launch>
<arg name="controller" value="stanley" />
<arg name="start_dist" default="0.0" />
<arg name="path" default="buggycourse_safe_1.json" />

<remap from="/NAND/nav/odom" to="/nav/odom"/>
<remap from="/buggy/input/steering" to="/NAND/buggy/input/steering"/>

<node name="serial_node" pkg="rosserial_python" type="serial_node.py">
<param name="port" type="string" value="/dev/nand-teensy"/>
<param name="baud" type="int" value="1000000"/>
</node>
<node name="foxglove" pkg="foxglove_bridge" type="foxglove_bridge" />
<node name="telematics" pkg="buggy" type="telematics.py" />




<!-- ENABLE AUTON -->
<!-- autonsystem args: controller start_dist path buggy_name is_sim -->
<arg name="autonsystem_args" value="--controller $(arg controller) --dist 0.0 --traj $(arg path) --self_name NAND" />
<node name="auton_system" pkg="buggy" type="autonsystem.py" output="screen" args="$(arg autonsystem_args)"/>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<arg name="NAND_exist" default="true"/>
<group if="$(arg NAND_exist)">
<!-- Run the simulation with NAND -->
<arg name="autonsystem_args" default="--controller $(arg controller) --dist 0.0 --traj $(arg path) --self_name SC --other_name NAND" />
<arg name="autonsystem_args" value="--controller $(arg controller) --dist 0.0 --traj $(arg path) --self_name SC --other_name NAND" />
<node name="auton_system" pkg="buggy" type="autonsystem.py" output="screen" args="$(arg autonsystem_args)"/>
</group>
<group unless="$(arg NAND_exist)">
<arg name="autonsystem_args" default="--controller $(arg controller) --dist 0.0 --traj $(arg path) --self_name SC" />
<arg name="autonsystem_args" value="--controller $(arg controller) --dist 0.0 --traj $(arg path) --self_name SC" />
<node name="auton_system" pkg="buggy" type="autonsystem.py" output="screen" args="$(arg autonsystem_args)"/>
</group>
</launch>
6 changes: 5 additions & 1 deletion rb_ws/src/buggy/scripts/auton/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ class Controller(ABC):

NAND_WHEELBASE = 1.3
SC_WHEELBASE = 1.104
WHEELBASE = SC_WHEELBASE
current_traj_index = 0

def __init__(self, start_index, buggy_name) -> None:
self.buggy_name = buggy_name
if buggy_name.upper() == 'NAND':
Controller.WHEELBASE = self.NAND_WHEELBASE
else:
Controller.WHEELBASE = self.SC_WHEELBASE

# self.trajectory_forward_1 = rospy.Publisher(
# buggy_name + "/auton/debug/forward1_navsat", NavSatFix, queue_size=1
# )
Expand Down
Loading