Skip to content
Snippets Groups Projects
Commit 6741b49f authored by Paul-Winpenny's avatar Paul-Winpenny
Browse files

Changed topic to just different one for start node in call mode .

parent 704a7f03
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,11 @@ namespace RobobinApp.Views ...@@ -52,6 +52,11 @@ namespace RobobinApp.Views
private void OnGraphicsViewTapped(object sender, TappedEventArgs e) private void OnGraphicsViewTapped(object sender, TappedEventArgs e)
{ {
if (App.WifiManager.Mode != "Call")
{
DisplayAlert("NO CALL","Bin must be in call mode to use this feature!","Sorry!");
return;
}
var tapPoint = e.GetPosition(GraphicsView); var tapPoint = e.GetPosition(GraphicsView);
var drawable = (GraphicsDrawable)Resources["drawable"]; var drawable = (GraphicsDrawable)Resources["drawable"];
......
...@@ -26,6 +26,11 @@ namespace RobobinApp.Views ...@@ -26,6 +26,11 @@ namespace RobobinApp.Views
private void OnGraphicsViewTapped(object sender, TappedEventArgs e) private void OnGraphicsViewTapped(object sender, TappedEventArgs e)
{ {
if (App.WifiManager.Mode != "Call")
{
DisplayAlert("NO CALL", "Bin must be in call mode to use this feature!", "Sorry!");
return;
}
var tapPoint = e.GetPosition(GraphicsView); var tapPoint = e.GetPosition(GraphicsView);
var drawable = (GraphicsDrawable)Resources["drawable"]; var drawable = (GraphicsDrawable)Resources["drawable"];
......
...@@ -66,6 +66,7 @@ class UWBNode(Node): ...@@ -66,6 +66,7 @@ class UWBNode(Node):
super().__init__('uwb_navigation_node') super().__init__('uwb_navigation_node')
self.publisher = self.create_publisher(Point, '/tag1_location', 10) self.publisher = self.create_publisher(Point, '/tag1_location', 10)
self.start_publisher = self.create_publisher(Point, '/start_location', 10)
self.target_location_pub = self.create_publisher(Point, '/target_location', 10) self.target_location_pub = self.create_publisher(Point, '/target_location', 10)
self.api_pub = self.create_publisher(String, '/api_command', 10) self.api_pub = self.create_publisher(String, '/api_command', 10)
...@@ -167,9 +168,9 @@ class UWBNode(Node): ...@@ -167,9 +168,9 @@ class UWBNode(Node):
# Extract yaw from quaternion using transforms3d # Extract yaw from quaternion using transforms3d
orientation_q = msg.orientation orientation_q = msg.orientation
orientation_list = [orientation_q.w, orientation_q.x, orientation_q.y, orientation_q.z] orientation_list = [orientation_q.w, orientation_q.x, orientation_q.y, orientation_q.z]
roll, pitch, yaw = quat2euler(orientation_list) # Converts quaternion to Euler angles # roll, pitch, yaw = quat2euler(orientation_list) # Converts quaternion to Euler angles
self.current_yaw = yaw # Update current yaw self.current_yaw = 0 # Update current yaw
# self.get_logger().info(f"IMU Yaw: {yaw:.2f} radians") # self.get_logger().info(f"IMU Yaw: {yaw:.2f} radians")
def determine_anchor_coords(self, measured_distances): def determine_anchor_coords(self, measured_distances):
...@@ -304,7 +305,7 @@ class UWBNode(Node): ...@@ -304,7 +305,7 @@ class UWBNode(Node):
# Publish current position # Publish current position
position_msg = Point(x=self.current_tag1_position[0], y=self.current_tag1_position[1], z=0.0) position_msg = Point(x=self.current_tag1_position[0], y=self.current_tag1_position[1], z=0.0)
self.publisher.publish(position_msg) self.start_publisher.publish(position_msg)
# Publish target position # Publish target position
target_msg = Point(x=target_pos[0], y=target_pos[1], z=0.0) target_msg = Point(x=target_pos[0], y=target_pos[1], z=0.0)
......
...@@ -13,7 +13,7 @@ class UWBPathingNode(Node): ...@@ -13,7 +13,7 @@ class UWBPathingNode(Node):
self.cmd_vel_pub = self.create_publisher(Twist, '/cmd_vel', 10) self.cmd_vel_pub = self.create_publisher(Twist, '/cmd_vel', 10)
# Subscriptions # Subscriptions
self.create_subscription(Point, '/tag1_location', self.current_location_callback, 10) self.create_subscription(Point, '/start_location', self.current_location_callback, 10)
self.create_subscription(Point, '/target_location', self.target_location_callback, 10) self.create_subscription(Point, '/target_location', self.target_location_callback, 10)
# Current and target positions # Current and target positions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment