mirror of
https://github.com/modelec/modelec-marcel-ROS.git
synced 2026-01-18 16:47:43 +01:00
update topic name
This commit is contained in:
@@ -4,7 +4,7 @@ import time
|
|||||||
import serial
|
import serial
|
||||||
|
|
||||||
# Set the parameters for the serial connection
|
# Set the parameters for the serial connection
|
||||||
serial_port = '/dev/pts/9' # Modify this to your serial port (e.g., 'COM3' on Windows)
|
serial_port = '/dev/pts/11' # Modify this to your serial port (e.g., 'COM3' on Windows)
|
||||||
baud_rate = 115200 # Modify this to your baud rate
|
baud_rate = 115200 # Modify this to your baud rate
|
||||||
|
|
||||||
# Open the serial connection
|
# Open the serial connection
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import math
|
|||||||
import threading
|
import threading
|
||||||
|
|
||||||
class SimulatedPCB:
|
class SimulatedPCB:
|
||||||
def __init__(self, port='/dev/pts/6', baud=115200):
|
def __init__(self, port='/dev/pts/9', baud=115200):
|
||||||
self.ser = serial.Serial(port, baud, timeout=1)
|
self.ser = serial.Serial(port, baud, timeout=1)
|
||||||
self.running = True
|
self.running = True
|
||||||
self.start = False
|
self.start = False
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Modelec
|
|||||||
auto request = std::make_shared<modelec_interfaces::srv::AddSerialListener::Request>();
|
auto request = std::make_shared<modelec_interfaces::srv::AddSerialListener::Request>();
|
||||||
request->name = "pcb_alim";
|
request->name = "pcb_alim";
|
||||||
request->bauds = 115200;
|
request->bauds = 115200;
|
||||||
request->serial_port = "/dev/pts/10"; // TODO : check the real serial port
|
request->serial_port = "/dev/pts/12"; // TODO : check the real serial port
|
||||||
auto client = this->create_client<modelec_interfaces::srv::AddSerialListener>("add_serial_listener");
|
auto client = this->create_client<modelec_interfaces::srv::AddSerialListener>("add_serial_listener");
|
||||||
while (!client->wait_for_service(std::chrono::seconds(1)))
|
while (!client->wait_for_service(std::chrono::seconds(1)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Modelec
|
|||||||
auto request = std::make_shared<modelec_interfaces::srv::AddSerialListener::Request>();
|
auto request = std::make_shared<modelec_interfaces::srv::AddSerialListener::Request>();
|
||||||
request->name = "pcb_odo";
|
request->name = "pcb_odo";
|
||||||
request->bauds = 115200;
|
request->bauds = 115200;
|
||||||
request->serial_port = "/dev/pts/7"; // TODO : check the real serial port
|
request->serial_port = "/dev/pts/10"; // TODO : check the real serial port
|
||||||
auto client = this->create_client<modelec_interfaces::srv::AddSerialListener>("add_serial_listener");
|
auto client = this->create_client<modelec_interfaces::srv::AddSerialListener>("add_serial_listener");
|
||||||
while (!client->wait_for_service(std::chrono::seconds(1)))
|
while (!client->wait_for_service(std::chrono::seconds(1)))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Modelec
|
|||||||
});
|
});
|
||||||
|
|
||||||
enemy_long_time_pub_ = this->create_publisher<modelec_interfaces::msg::OdometryPos>(
|
enemy_long_time_pub_ = this->create_publisher<modelec_interfaces::msg::OdometryPos>(
|
||||||
"/enemy/long-time", 10);
|
"/enemy/long_time", 10);
|
||||||
|
|
||||||
timer_ = this->create_wall_timer(
|
timer_ = this->create_wall_timer(
|
||||||
std::chrono::seconds(1),
|
std::chrono::seconds(1),
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace Modelec {
|
|||||||
});
|
});
|
||||||
|
|
||||||
enemy_pos_long_time_sub_ = node_->create_subscription<modelec_interfaces::msg::OdometryPos>(
|
enemy_pos_long_time_sub_ = node_->create_subscription<modelec_interfaces::msg::OdometryPos>(
|
||||||
"/enemy/long-time", 10,
|
"/enemy/long_time", 10,
|
||||||
[this](const modelec_interfaces::msg::OdometryPos::SharedPtr msg)
|
[this](const modelec_interfaces::msg::OdometryPos::SharedPtr msg)
|
||||||
{
|
{
|
||||||
OnEnemyPositionLongTime(msg);
|
OnEnemyPositionLongTime(msg);
|
||||||
|
|||||||
Reference in New Issue
Block a user