forked from CMU-Robotics-Club/RoboBuggy2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Evan <evan@brucemcrooster.dev> Co-authored-by: monkeymango55 <90772792+sophizhao@users.noreply.github.com> Co-authored-by: TiaSinghania <samanvita.singhania@gmail.com> Co-authored-by: Saransh Agrawal <saransh323@gmail.com> Co-authored-by: ShortCircuit <officers@roboclub.org> Co-authored-by: TiaSinghania <TiaSinghania@users.noreply.github.com> Co-authored-by: Gyanepsaa Singh <GyanepsaaS@users.noreply.github.com> Co-authored-by: Tucker Shea <tucker@tuckershea.com> Co-authored-by: Alden-G878 <Alden-G878@users.noreply.github.com> Co-authored-by: garrison2 <garrison2@users.noreply.github.com> Co-authored-by: delaynie <thetaspirit@users.noreply.github.com>
- Loading branch information
1 parent
5401650
commit 049ede2
Showing
20 changed files
with
858 additions
and
250 deletions.
There are no files selected for viewing
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
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,7 +1,7 @@ | ||
matplotlib | ||
NavPy | ||
numba | ||
numpy | ||
numpy<2 | ||
osqp | ||
pandas | ||
pymap3d | ||
|
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,4 @@ | ||
#!/bin/sh | ||
export RBROOT=/home/nuc/robobuggy-software/rb_ws | ||
export PYTHONPATH=$PYTHONPATH:$RBROOT/src/buggy/scripts | ||
export TRAJPATH=$RBROOT/src/buggy/paths/ |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,19 @@ | ||
/**: # Global Params | ||
ros__parameters: | ||
traj_name: "UC_to_purnell.json" | ||
|
||
SC: | ||
bnyahaj: | ||
ros__parameters: | ||
teensy_name: "ttyUSB0" | ||
|
||
SC_controller: | ||
ros__parameters: | ||
dist: 0.0 | ||
# traj_name: "buggycourse_safe.json" | ||
controller: "stanley" | ||
|
||
SC_path_planner: | ||
ros__parameters: | ||
# traj_name: "buggycourse_safe.json" | ||
curb_name: "" |
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
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,5 @@ | ||
<launch> | ||
<node pkg="foxglove_bridge" exec="foxglove_bridge" name="foxglove" namespace="SC"/> | ||
<node name="debug_steer" pkg="buggy" exec="debug_steer.py" output="screen"/> | ||
<node name="bnyahaj" pkg="buggy" exec="ros_to_bnyahaj.py" output="screen" respawn="true" args="--self_name SC --other_name NAND --teensy_name ttyUSB0" namespace="SC"/> | ||
</launch> |
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,9 @@ | ||
<launch> | ||
<arg name="config_file" default="src/buggy/config/sc-mockroll.yaml"/> | ||
<node pkg="buggy" exec="controller_node.py" name="SC_controller" output = "screen" namespace="SC"> | ||
<param from="$(var config_file)"/> | ||
</node> | ||
<node pkg="buggy" exec="path_planner.py" name="SC_path_planner" namespace="SC" output = "screen"> | ||
<param from="$(var config_file)"/> | ||
</node> | ||
</launch> |
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,16 @@ | ||
<launch> | ||
<include file="$(find-pkg-share microstrain_inertial_driver)/launch/microstrain_launch.py"> | ||
<arg name="params_file" value="$(env RBROOT)/src/buggy/INS_params.yml"/> | ||
</include> | ||
<arg name="config_file" default="src/buggy/config/sc-mockroll.yaml"/> | ||
|
||
<node pkg="foxglove_bridge" exec="foxglove_bridge" name="foxglove" output = "screen" namespace="SC"/> | ||
|
||
<node name="bnyahaj" pkg="buggy" exec="ros_to_bnyahaj.py" respawn="true" output="screen" namespace="SC"> | ||
<param from="$(var config_file)"/> | ||
</node> | ||
<node name="stateconverter" pkg = "buggy" exec = "buggy_state_converter.py" output="screen" namespace="SC"/> | ||
|
||
<node name="telematics" pkg="buggy" exec="telematics.py" namespace="SC" output="screen"/> | ||
<node name="watchdog" pkg="buggy" exec="watchdog_node.py" namespace="SC" output="screen"/> | ||
</launch> |
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,12 @@ | ||
float64 heading_rate | ||
float64 encoder_angle | ||
float64 rc_steering_angle | ||
float64 software_steering_angle | ||
float64 true_steering_angle | ||
int32 rfm69_timeout_num | ||
bool operator_ready | ||
bool brake_status | ||
bool auton_steer | ||
bool tx12_state | ||
uint8 stepper_alarm | ||
uint8 rc_uplink_quality |
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,6 @@ | ||
float64 easting | ||
float64 northing | ||
float64 accuracy | ||
uint64 gps_time | ||
int32 gps_seqnum | ||
uint8 gps_fix |
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,10 @@ | ||
float64 encoder_angle | ||
float64 rc_steering_angle | ||
float64 software_steering_angle | ||
float64 true_steering_angle | ||
bool operator_ready | ||
bool brake_status | ||
bool use_auton_steer | ||
bool tx12_state | ||
uint8 stepper_alarm | ||
uint8 rc_uplink_qual |
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,2 @@ | ||
float64 velocity | ||
float32 steering_angle |
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
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
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,66 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import rclpy | ||
from rclpy.node import Node | ||
from std_msgs.msg import Float64 | ||
import numpy as np | ||
|
||
|
||
""" | ||
Debug Controller | ||
Sends oscillating steering command for firmware and system level debug | ||
""" | ||
class DebugController(Node): | ||
|
||
""" | ||
@input: self_name, for namespace for current buggy | ||
Initializes steer publisher to publish steering angles | ||
Tick = 1ms | ||
""" | ||
def __init__(self) -> None: | ||
super().__init__("debug_steer") | ||
self.steer_publisher = self.create_publisher( | ||
Float64, "/input/steering", 10) | ||
self.rate = 1000 # Hz | ||
self.tick_count = 0 | ||
self.steer_cmd = 0.0 | ||
|
||
# Create a timer to call the loop function | ||
self.timer = self.create_timer(1.0 / self.rate, self.loop) | ||
|
||
# Outputs a continuous sine wave ranging from -50 to 50, with a period of 500 ticks | ||
def sin_steer(self, tick_count): | ||
return 50 * np.sin((2 * np.pi) * tick_count/500) | ||
|
||
#returns a constant steering angle of 42 degrees | ||
def constant_steer(self, _): | ||
return 42.0 | ||
|
||
#Creates a loop based on tick counter | ||
def loop(self): | ||
self.steer_cmd = self.sin_steer(self.tick_count) | ||
msg = Float64() | ||
msg.data = self.steer_cmd | ||
# if self.tick_count % 10 == 0: | ||
# self.get_logger().info(f"SIN STEER: {self.steer_cmd}") | ||
self.steer_publisher.publish(msg) | ||
|
||
self.tick_count += 1 | ||
|
||
|
||
def main(args=None): | ||
rclpy.init(args=args) | ||
|
||
debug_steer = DebugController() | ||
|
||
rclpy.spin(debug_steer) | ||
|
||
# Destroy the node explicitly | ||
# (optional - otherwise it will be done automatically | ||
# when the garbage collector destroys the node object) | ||
debug_steer.destroy_node() | ||
rclpy.shutdown() | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
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
Oops, something went wrong.