-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8299aa3
commit 902322a
Showing
9 changed files
with
215 additions
and
893 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,3 +58,5 @@ sysinfo.txt | |
# Crashlytics generated file | ||
crashlytics-build.properties | ||
|
||
# Ignore config | ||
config.json |
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,43 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
namespace RosSharp.RosBridgeClient | ||
{ | ||
public class IGVCConfigLoader : MonoBehaviour | ||
{ | ||
|
||
private SimpleCarController simpleCarController; | ||
private RosConnector rosConnector; | ||
private ImagePublisher imagePublisher; | ||
private LaserScanPublisher laserScanPublisher; | ||
private IMUPublisher iMUPublisher; | ||
private VelocityPublisher velocityPublisher; | ||
private GPSPublisher gPSPublisher; | ||
private MotorsSubscriber motorsSubscriber; | ||
|
||
void Start() | ||
{ | ||
if (MenuValues._instance != null) | ||
{ | ||
simpleCarController = this.GetComponent<SimpleCarController>(); | ||
rosConnector = this.GetComponent<RosConnector>(); | ||
imagePublisher = this.GetComponent<ImagePublisher>(); | ||
laserScanPublisher = this.GetComponent<LaserScanPublisher>(); | ||
iMUPublisher = this.GetComponent<IMUPublisher>(); | ||
velocityPublisher = this.GetComponent<VelocityPublisher>(); | ||
gPSPublisher = this.GetComponent<GPSPublisher>(); | ||
motorsSubscriber = this.GetComponent<MotorsSubscriber>(); | ||
|
||
simpleCarController.useController = !MenuValues._instance.autonomous.Equals("True"); | ||
rosConnector.RosBridgeServerUrl = "ws://" + MenuValues._instance.ros_bridge_url; | ||
imagePublisher.Topic = MenuValues._instance.camera_topic; | ||
laserScanPublisher.Topic = MenuValues._instance.laser_scan_topic; | ||
iMUPublisher.Topic = MenuValues._instance.imu_topic; | ||
velocityPublisher.Topic = MenuValues._instance.velocity_topic; | ||
gPSPublisher.Topic = MenuValues._instance.gps_topic; | ||
motorsSubscriber.Topic = MenuValues._instance.motors_topic; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,16 +1,21 @@ | ||
using System.Collections; | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
static class MenuValues | ||
[Serializable] | ||
public class MenuValues | ||
{ | ||
public static bool autonomous; | ||
public static string camera_topic; | ||
public static string heading_topic; | ||
public static string velocity_topic; | ||
public static string acceleration_topic; | ||
public static string gps_topic; | ||
public static string laser_scan_topic; | ||
public static string motors_topic; | ||
public static string ros_bridge_url; | ||
|
||
[NonSerialized] | ||
public static MenuValues _instance; | ||
|
||
public string autonomous; | ||
public string camera_topic; | ||
public string imu_topic; | ||
public string velocity_topic; | ||
public string gps_topic; | ||
public string laser_scan_topic; | ||
public string motors_topic; | ||
public string ros_bridge_url; | ||
} |
Oops, something went wrong.