LingxinMeng 10 месяцев назад
Родитель
Сommit
7efaaff5fa

+ 11 - 0
aarch64/pjibot_delivery/master/package/config/master_trigger_cfg.go

@@ -6,6 +6,7 @@ import (
 	"cicv-data-closedloop/common/util"
 	pji_msgs "cicv-data-closedloop/pjibot_delivery_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/geometry_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/nav_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/sensor_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/std_msgs"
@@ -34,6 +35,9 @@ var (
 	// 6
 	TopicOfSysInfo = "/sys_info"
 	RuleOfSysInfo  []func(data *pji_msgs.SysInfo) string
+	// 7
+	TopicOfRobotPose = "/robot_pose"
+	RuleOfRobotPose  []func(data *geometry_msgs.PoseStamped) string
 )
 
 func InitTriggerConfig() {
@@ -116,6 +120,13 @@ func InitTriggerConfig() {
 				continue
 			}
 			RuleOfSysInfo = append(RuleOfSysInfo, f)
+		} else if TopicOfRobotPose == topic2 { // 7
+			f, ok := rule.(func(data *geometry_msgs.PoseStamped) string)
+			if ok != true {
+				c_log.GlobalLogger.Error("插件", triggerLocalPath, "中的Topic方法必须是(func(data *pji_msgs.SysInfo) string):", err)
+				continue
+			}
+			RuleOfRobotPose = append(RuleOfRobotPose, f)
 		} else {
 			c_log.GlobalLogger.Error("未知的topic:", topic2)
 			continue

+ 11 - 0
aarch64/pjibot_patrol/master/package/config/master_trigger_cfg.go

@@ -6,6 +6,7 @@ import (
 	"cicv-data-closedloop/common/util"
 	pji_msgs "cicv-data-closedloop/pjibot_patrol_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/geometry_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/nav_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/sensor_msgs"
 	"github.com/bluenviron/goroslib/v2/pkg/msgs/std_msgs"
@@ -34,6 +35,9 @@ var (
 	// 6
 	TopicOfSysInfo = "/sys_info"
 	RuleOfSysInfo  []func(data *pji_msgs.SysInfo) string
+	// 7
+	TopicOfRobotPose = "/robot_pose"
+	RuleOfRobotPose  []func(data *geometry_msgs.PoseStamped) string
 )
 
 func InitTriggerConfig() {
@@ -116,6 +120,13 @@ func InitTriggerConfig() {
 				continue
 			}
 			RuleOfSysInfo = append(RuleOfSysInfo, f)
+		} else if TopicOfRobotPose == topic2 { // 7
+			f, ok := rule.(func(data *geometry_msgs.PoseStamped) string)
+			if ok != true {
+				c_log.GlobalLogger.Error("插件", triggerLocalPath, "中的Topic方法必须是(func(data *pji_msgs.SysInfo) string):", err)
+				continue
+			}
+			RuleOfRobotPose = append(RuleOfRobotPose, f)
 		} else {
 			c_log.GlobalLogger.Error("未知的topic:", topic2)
 			continue