Test branch
This commit is contained in:
parent
fde9c007d2
commit
d63c1435b6
@ -2,7 +2,7 @@ auto_mission_handler_node:
|
||||
# parameters
|
||||
ros__parameters:
|
||||
# redis
|
||||
redis_host: "192.168.1.110" # "127.0.0.1"
|
||||
redis_host: "127.0.0.1" # "127.0.0.1"
|
||||
redis_port: 6379
|
||||
redis_db: 0
|
||||
|
||||
@ -20,7 +20,7 @@ path_follow_handler_node:
|
||||
# parameters
|
||||
ros__parameters:
|
||||
# redis
|
||||
redis_host: "192.168.1.110" # "127.0.0.1"
|
||||
redis_host: "127.0.0.1" # "127.0.0.1"
|
||||
redis_port: 6379
|
||||
redis_db: 0
|
||||
|
||||
@ -40,7 +40,7 @@ mission_center_node:
|
||||
# parameters
|
||||
ros__parameters:
|
||||
# redis
|
||||
redis_host: "192.168.1.110" # "127.0.0.1"
|
||||
redis_host: "127.0.0.1" # "127.0.0.1"
|
||||
redis_port: 6379
|
||||
redis_db: 0
|
||||
|
||||
@ -20,20 +20,20 @@ class MockPoseNode(Node):
|
||||
)
|
||||
self.get_logger().info("Service /start_pose ready, always return success=True")
|
||||
|
||||
# 2. rtk_pose publisher
|
||||
self.pub_rtk = self.create_publisher(
|
||||
PoseWithCovarianceStamped,
|
||||
"/rtk_pose",
|
||||
10
|
||||
)
|
||||
# # 2. rtk_pose publisher
|
||||
# self.pub_rtk = self.create_publisher(
|
||||
# PoseWithCovarianceStamped,
|
||||
# "/rtk_pose",
|
||||
# 10
|
||||
# )
|
||||
|
||||
self.url = url
|
||||
self.coord_list = []
|
||||
self.load_geojson()
|
||||
# self.url = url
|
||||
# self.coord_list = []
|
||||
# self.load_geojson()
|
||||
|
||||
self.index = 0
|
||||
self.timer_period = 0.2
|
||||
self.timer = self.create_timer(self.timer_period, self.publish_rtk_pose_cb)
|
||||
# self.index = 0
|
||||
# self.timer_period = 0.2
|
||||
# self.timer = self.create_timer(self.timer_period, self.publish_rtk_pose_cb)
|
||||
|
||||
def load_geojson(self):
|
||||
try:
|
||||
@ -53,40 +53,40 @@ class MockPoseNode(Node):
|
||||
response.success = True
|
||||
return response
|
||||
|
||||
def publish_rtk_pose_cb(self):
|
||||
if not self.coord_list:
|
||||
return
|
||||
# def publish_rtk_pose_cb(self):
|
||||
# if not self.coord_list:
|
||||
# return
|
||||
|
||||
lon, lat, alt = self.coord_list[self.index]
|
||||
# lon, lat, alt = self.coord_list[self.index]
|
||||
|
||||
msg = PoseWithCovarianceStamped()
|
||||
msg.header.stamp = self.get_clock().now().to_msg()
|
||||
msg.header.frame_id = "enu"
|
||||
# msg = PoseWithCovarianceStamped()
|
||||
# msg.header.stamp = self.get_clock().now().to_msg()
|
||||
# msg.header.frame_id = "enu"
|
||||
|
||||
msg.pose.pose.position.x = lon
|
||||
msg.pose.pose.position.y = lat
|
||||
msg.pose.pose.position.z = alt
|
||||
# msg.pose.pose.position.x = lon
|
||||
# msg.pose.pose.position.y = lat
|
||||
# msg.pose.pose.position.z = alt
|
||||
|
||||
msg.pose.pose.orientation.w = 1.0
|
||||
msg.pose.pose.orientation.x = 0.0
|
||||
msg.pose.pose.orientation.y = 0.0
|
||||
msg.pose.pose.orientation.z = 0.0
|
||||
# msg.pose.pose.orientation.w = 1.0
|
||||
# msg.pose.pose.orientation.x = 0.0
|
||||
# msg.pose.pose.orientation.y = 0.0
|
||||
# msg.pose.pose.orientation.z = 0.0
|
||||
|
||||
for i in range(36):
|
||||
msg.pose.covariance[i] = 0.0
|
||||
# for i in range(36):
|
||||
# msg.pose.covariance[i] = 0.0
|
||||
|
||||
self.pub_rtk.publish(msg)
|
||||
# self.pub_rtk.publish(msg)
|
||||
|
||||
self.index += 1
|
||||
if self.index >= len(self.coord_list):
|
||||
self.index = 0
|
||||
# self.index += 1
|
||||
# if self.index >= len(self.coord_list):
|
||||
# self.index = 0
|
||||
|
||||
|
||||
def main(args=None):
|
||||
# 解析命令行参数,注意:分离ros args和自定义argparse参数
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--url", type=str,
|
||||
default="https://test.sweetai.cn:4433/load/locationCmdPath/1701148411059699712.json",
|
||||
default="https://test.sweetai.cn:4433/load/locationCmdPath/1700080420079468544.json",
|
||||
help="geojson path url")
|
||||
parsed_args, ros_args = parser.parse_known_args(args)
|
||||
|
||||
@ -119,4 +119,4 @@ if __name__ == "__main__":
|
||||
3. `/start_pose`服务不解析请求参数,任何入参直接返回`success=True`,完全匹配你的需求。
|
||||
4. frame_id 写为`map`,你可以根据实际工程改成`enu`。
|
||||
5. 发布周期`timer_period = 0.2`,可按需调快 / 调慢。
|
||||
'''
|
||||
'''
|
||||
@ -349,6 +349,7 @@ void MissionCenterNode::missionOnCallback(
|
||||
const auto_drive_proj_msg::srv::ReqString::Request::SharedPtr request,
|
||||
auto_drive_proj_msg::srv::ReqString::Response::SharedPtr response)
|
||||
{
|
||||
LOG_INFO("========================== /invoke/missionOn request=");
|
||||
try {
|
||||
LOG_INFO("Received /invoke/missionOn request: {}", request->request);
|
||||
|
||||
@ -427,7 +428,7 @@ void MissionCenterNode::missionOnCallback(
|
||||
response->success = true;
|
||||
response->message = "Mission request accepted, processing in background";
|
||||
LOG_INFO("mission on cb, set main state to WAIT MIS RSP, Mission request accepted, processing in background");
|
||||
|
||||
LOG_INFO("========================== /invoke/missionOn request= end");
|
||||
} catch (const std::exception& e) {
|
||||
response->success = false;
|
||||
response->message = std::string("Exception: ") + e.what();
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user