我正在尝试为航点移动模型添加航点,但我无法这样做。这就是我所做的
Ptr<WaypointMobilityModel> waypoints = CreateObject<WaypointMobilityModel> ();
waypoints->AddWaypoint (Waypoint (Seconds (2.0),Vector (25.0, 0, 0)));
waypoints->AddWaypoint (Waypoint (Seconds (5.0),Vector (50.0, 0, 0)));
mobility.SetMobilityModel(waypoints); //mobility is my MobilityHelper
SetMobilityModel需要一个字符串,而是在使用参数waypoints调用时获取ptr。你能说出这样做的正确方法吗?
这是我得到的错误:
no matching function for call to ‘ns3::MobilityHelper::SetMobilityModel(ns3::Ptr<ns3::WaypointMobilityModel>&)’
mobility.SetMobilityModel(waypoints);
note: no known conversion for argument 1 from ‘ns3::Ptr<ns3::WaypointMobilityModel>’ to ‘std::string {aka std::basic_string<char>}’