HJReachability / ilqgames_ros

ROS wrappers for ILQGames.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Conflict of dependancies in the ros node #1

Open aalghooneh opened 1 year ago

aalghooneh commented 1 year ago

Hi

thanks for sharing your code,

I think you referenced methods that doesn't exist in the "https://github.com/HJReachability/ilqgames/tree/v0.0.2"

in receding_horizon_planner.cpp for example, this type const ConcatenatedDynamicalSystem& dynamics,

doesn't have this methodSubsystemXDim(ii),

hence the ros package cannot be built, also when somebody tries to build the external package it clones v.0.0.1 instead of v.0.0.2 and the methods won't match for compilation. It would be great if you tell us which version matches with this rosnode

in the script, line 216, the Splice method need time argument as well for v.0.0.2

    ros_time=ros::Time::now().toSec();
    solution_splicer_->Splice(*log, ros_time)

such case is also for the two other scripts, in three_player_vicon_demo.cpp line 114 uses an overload of ConcatenatedDynamicalSystem that doesnt exist in the class definition.

it would be great if you could address these

dfridovi commented 1 year ago

I am not sure why you are using v0.0.2 when the external build automatically grabs master, which has all of these methods. Try the normal ROS build process, i.e.:

> catkin_make_isolated 
> catkin_make

where you execute the first command from within external/ and the second from within ros/.

https://github.com/HJReachability/ilqgames_ros/blob/3d80a17db884ab0bec3f0ef3c9c1696745174e67/external/src/ilqgames/CMakeLists.txt#L10

https://github.com/HJReachability/ilqgames/blob/8908a96444c0b82938f0f581965bf65d03d70274/include/ilqgames/dynamics/concatenated_dynamical_system.h#L92

aalghooneh commented 1 year ago

thanks for the response,

I have used the v.0.0.2 tag, because with the master branch line 79, form receding_horizon_planner.cpp doesn't work.

class problem does not have the method Solver() in its definition, but v.0.0.2 tag had it.

*static_cast<const ConcatenatedDynamicalSystem*>(&problem_->Solver().Dynamics());

For more information, this is what the catkin_make throws after catkin_make in ros/

/home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp: In member function ‘bool ilqgames::ilqgames_ros::RecedingHorizonPlanner::Initialize(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:79:22: error: ‘using elementtype = class ilqgames::TopDownRenderableProblem {aka class ilqgames::TopDownRenderableProblem}’ has no member named ‘Solver’ &problem->Solver().Dynamics()); ^~ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/single_player_dubins_car.h:54:0, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:43: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp: In member function ‘bool ilqgames::ilqgames_ros::RecedingHorizonPlanner::LoadParameters(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:98:44: error: ‘using element_type = class ilqgames::TopDownRenderableProblem {aka class ilqgames::TopDownRenderableProblem}’ has no member named ‘Solver’ CHECK_EQ(statetopics.size(), problem_->Solver().Dynamics().NumPlayers()); ^ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp: In member function ‘void ilqgames::ilqgames_ros::RecedingHorizonPlanner::Plan()’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:179:25: error: ‘using elementtype = class ilqgames::TopDownRenderableProblem {aka class ilqgames::TopDownRenderableProblem}’ has no member named ‘Solver’ VectorXf x0(problem->Solver().Dynamics().XDim()); ^~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:204:30: error: ‘using elementtype = class ilqgames::TopDownRenderableProblem {aka class ilqgames::TopDownRenderableProblem}’ has no member named ‘Solve’ const auto log = problem->Solve(planner_runtime); ^~~~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp: In constructor ‘ilqgames_ros::ThreePlayerViconDemo::ThreePlayerViconDemo(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:117:20: error: no matching function for call to ‘ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(, const Time&)’ kTimeStep)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:52:0: /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const SubsystemList&) ConcatenatedDynamicalSystem(const SubsystemList& subsystems); ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate expects 1 argument, 2 provided /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const ilqgames::ConcatenatedDynamicalSystem&) class ConcatenatedDynamicalSystem : public MultiPlayerDynamicalSystem { ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate expects 1 argument, 2 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:131:78: error: no matching function for call to ‘ilqgames::OperatingPoint::OperatingPoint(const size_t&, ilqgames::PlayerIndex, double, const std::shared_ptr&)’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: candidate: template ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::Time, const std::shared_ptr&) OperatingPoint(size_t num_time_steps, Time initial_time, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: template argument deduction/substitution failed: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:131:78: note: mismatched types ‘const std::shared_ptr’ and ‘double’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate: ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::PlayerIndex, ilqgames::Time) OperatingPoint(size_t num_time_steps, PlayerIndex num_players, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate expects 3 arguments, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(const ilqgames::OperatingPoint&) struct OperatingPoint { ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(ilqgames::OperatingPoint&&) /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp: In constructor ‘ilqgames_ros::TwoPlayerViconDemo::TwoPlayerViconDemo(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:108:78: error: no matching function for call to ‘ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(, const Time&)’ {std::make_shared(), std::make_shared(kDubinsV)}, kTimeStep)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:52:0: /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const SubsystemList&) ConcatenatedDynamicalSystem(const SubsystemList& subsystems); ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate expects 1 argument, 2 provided /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const ilqgames::ConcatenatedDynamicalSystem&) class ConcatenatedDynamicalSystem : public MultiPlayerDynamicalSystem { ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate expects 1 argument, 2 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:122:78: error: no matching function for call to ‘ilqgames::OperatingPoint::OperatingPoint(const size_t&, ilqgames::PlayerIndex, double, const std::shared_ptr&)’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: candidate: template ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::Time, const std::shared_ptr&) OperatingPoint(size_t num_time_steps, Time initial_time, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: template argument deduction/substitution failed: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:122:78: note: mismatched types ‘const std::shared_ptr’ and ‘double’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate: ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::PlayerIndex, ilqgames::Time) OperatingPoint(size_t num_time_steps, PlayerIndex num_players, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate expects 3 arguments, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(const ilqgames::OperatingPoint&) struct OperatingPoint { ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(ilqgames::OperatingPoint&&) /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicondemo.cpp:239:3: error: ‘solver’ was not declared in this scope solver_.reset( ^~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:240:72: error: no matching function for call to ‘ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, , const Time&)’ new ILQSolver(dynamics, {p1_cost, p2_cost, p3_cost}, kTimeHorizon)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:56:0: /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate: ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, const ilqgames::SolverParams&) ILQSolver(const std::shared_ptr& problem, ^~~~~ /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate expects 2 arguments, 3 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicondemo.cpp:201:3: error: ‘solver’ was not declared in this scope solver_.reset( ^~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:202:63: error: no matching function for call to ‘ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, , const Time&)’ new ILQSolver(dynamics, {p1_cost, p2_cost}, kTimeHorizon)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:56:0: /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate: ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, const ilqgames::SolverParams&) ILQSolver(const std::shared_ptr& problem, ^~~~~ /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate expects 2 arguments, 3 provided ilqgames_ros/CMakeFiles/ilqgames_ros.dir/build.make:75: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/receding_horizon_planner.cpp.o' failed make[2]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/receding_horizon_planner.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... ilqgames_ros/CMakeFiles/ilqgames_ros.dir/build.make:103: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/two_player_vicon_demo.cpp.o' failed make[2]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/two_player_vicon_demo.cpp.o] Error 1 ilqgames_ros/CMakeFiles/ilqgames_ros.dir/build.make:89: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/three_player_vicon_demo.cpp.o' failed make[2]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/three_player_vicon_demo.cpp.o] Error 1 CMakeFiles/Makefile2:1480: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/all' failed make[1]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/all] Error 2 Makefile:145: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j16 -l16" failed

dfridovi commented 1 year ago

Oops. No idea at what point these diverged... but it appears to be a minor issue. If you inspect the header for the TopDownRenderableProblem class, it appears that it directly has the Dynamics() method so you can just splice out the ->Solver() call. Apologies for the confusion.

dfridovi commented 1 year ago

Definitely stay on master though because I'm sure there were some important changes that happened after v0.0.2

aalghooneh commented 1 year ago

I'm afraid that wouldn't solve it, if I use dynamics directly it will output MultiPlayerIntegrableSystem type, and it cannot static_cast into ConcatenatedDynamicalSystem. This the whole error after removing Solver

there are also other erros, problem_ does not have NumPlayer() method

/home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:79:119: error: invalid static_cast from type ‘const std::shared_ptr’ to type ‘const ilqgames::ConcatenatedDynamicalSystem’ const ConcatenatedDynamicalSystem& dynamics = static_cast<const ConcatenatedDynamicalSystem>(&problem_->Dynamics()); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/single_player_dubins_car.h:54:0, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:43: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp: In member function ‘bool ilqgames::ilqgames_ros::RecedingHorizonPlanner::LoadParameters(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:101:55: error: ‘const class std::shared_ptr’ has no member named ‘NumPlayers’ CHECK_EQ(statetopics.size(), problem_->Dynamics().NumPlayers()); ^ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp: In member function ‘void ilqgames::ilqgames_ros::RecedingHorizonPlanner::Plan()’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:182:36: error: ‘const class std::sharedptr’ has no member named ‘XDim’ VectorXf x0(problem->Dynamics().XDim()); ^~~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/receding_horizon_planner.cpp:207:30: error: ‘using elementtype = class ilqgames::TopDownRenderableProblem {aka class ilqgames::TopDownRenderableProblem}’ has no member named ‘Solve’ const auto log = problem->Solve(planner_runtime); ^~~~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp: In constructor ‘ilqgames_ros::ThreePlayerViconDemo::ThreePlayerViconDemo(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:117:20: error: no matching function for call to ‘ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(, const Time&)’ kTimeStep)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:52:0: /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const SubsystemList&) ConcatenatedDynamicalSystem(const SubsystemList& subsystems); ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate expects 1 argument, 2 provided /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const ilqgames::ConcatenatedDynamicalSystem&) class ConcatenatedDynamicalSystem : public MultiPlayerDynamicalSystem { ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate expects 1 argument, 2 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:131:78: error: no matching function for call to ‘ilqgames::OperatingPoint::OperatingPoint(const size_t&, ilqgames::PlayerIndex, double, const std::shared_ptr&)’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: candidate: template ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::Time, const std::shared_ptr&) OperatingPoint(size_t num_time_steps, Time initial_time, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: template argument deduction/substitution failed: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:131:78: note: mismatched types ‘const std::shared_ptr’ and ‘double’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate: ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::PlayerIndex, ilqgames::Time) OperatingPoint(size_t num_time_steps, PlayerIndex num_players, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate expects 3 arguments, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(const ilqgames::OperatingPoint&) struct OperatingPoint { ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(ilqgames::OperatingPoint&&) /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp: In constructor ‘ilqgames_ros::TwoPlayerViconDemo::TwoPlayerViconDemo(const ros::NodeHandle&)’: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:108:78: error: no matching function for call to ‘ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(, const Time&)’ {std::make_shared(), std::make_shared(kDubinsV)}, kTimeStep)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:52:0: /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const SubsystemList&) ConcatenatedDynamicalSystem(const SubsystemList& subsystems); ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:60:3: note: candidate expects 1 argument, 2 provided /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate: ilqgames::ConcatenatedDynamicalSystem::ConcatenatedDynamicalSystem(const ilqgames::ConcatenatedDynamicalSystem&) class ConcatenatedDynamicalSystem : public MultiPlayerDynamicalSystem { ^~~~~~~ /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:57:7: note: candidate expects 1 argument, 2 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:122:78: error: no matching function for call to ‘ilqgames::OperatingPoint::OperatingPoint(const size_t&, ilqgames::PlayerIndex, double, const std::shared_ptr&)’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: candidate: template ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::Time, const std::shared_ptr&) OperatingPoint(size_t num_time_steps, Time initial_time, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:72:3: note: template argument deduction/substitution failed: /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:122:78: note: mismatched types ‘const std::shared_ptr’ and ‘double’ new OperatingPoint(kNumTimeSteps, dynamics->NumPlayers(), 0.0, dynamics)); ^ In file included from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_integrable_system.h:47:0, from /usr/local/include/ilqgames/ilqgames/dynamics/multi_player_dynamical_system.h:47, from /usr/local/include/ilqgames/ilqgames/dynamics/concatenated_dynamical_system.h:46, from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:52: /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate: ilqgames::OperatingPoint::OperatingPoint(size_t, ilqgames::PlayerIndex, ilqgames::Time) OperatingPoint(size_t num_time_steps, PlayerIndex num_players, ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:68:3: note: candidate expects 3 arguments, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(const ilqgames::OperatingPoint&) struct OperatingPoint { ^~~~~~ /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate: ilqgames::OperatingPoint::OperatingPoint(ilqgames::OperatingPoint&&) /usr/local/include/ilqgames/ilqgames/utils/operating_point.h:55:8: note: candidate expects 1 argument, 4 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicondemo.cpp:239:3: error: ‘solver’ was not declared in this scope solver_.reset( ^~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:240:72: error: no matching function for call to ‘ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, , const Time&)’ new ILQSolver(dynamics, {p1_cost, p2_cost, p3_cost}, kTimeHorizon)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/three_player_vicon_demo.cpp:56:0: /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate: ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, const ilqgames::SolverParams&) ILQSolver(const std::shared_ptr& problem, ^~~~~ /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate expects 2 arguments, 3 provided /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicondemo.cpp:201:3: error: ‘solver’ was not declared in this scope solver_.reset( ^~~ /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:202:63: error: no matching function for call to ‘ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, , const Time&)’ new ILQSolver(dynamics, {p1_cost, p2_cost}, kTimeHorizon)); ^ In file included from /home/dastan/Documents/CODE/ilqg/ros_ws/ilqgames_ros/ros/src/ilqgames_ros/src/two_player_vicon_demo.cpp:56:0: /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate: ilqgames::ILQSolver::ILQSolver(const std::shared_ptr&, const ilqgames::SolverParams&) ILQSolver(const std::shared_ptr& problem, ^~~~~ /usr/local/include/ilqgames/ilqgames/solver/ilq_solver.h:69:3: note: candidate expects 2 arguments, 3 provided ilqgames_ros/CMakeFiles/ilqgames_ros.dir/build.make:75: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/receding_horizon_planner.cpp.o' failed make[2]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/receding_horizon_planner.cpp.o] Error 1 make[2]: Waiting for unfinished jobs.... ilqgames_ros/CMakeFiles/ilqgames_ros.dir/build.make:89: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/three_player_vicon_demo.cpp.o' failed make[2]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/three_player_vicon_demo.cpp.o] Error 1 ilqgames_ros/CMakeFiles/ilqgames_ros.dir/build.make:103: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/two_player_vicon_demo.cpp.o' failed make[2]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/src/two_player_vicon_demo.cpp.o] Error 1 CMakeFiles/Makefile2:1480: recipe for target 'ilqgames_ros/CMakeFiles/ilqgames_ros.dir/all' failed make[1]: [ilqgames_ros/CMakeFiles/ilqgames_ros.dir/all] Error 2 Makefile:145: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j16 -l16" failed

dfridovi commented 1 year ago

As you can see from the inheritance diagram (https://hjreachability.github.io/ilqgames/documentation/html/classilqgames_1_1_concatenated_dynamical_system.html), the ConcatenatedDynamicalSystem class is derived from the MultiPlayerIntegrableSystem class, and hence should be up-castable. The error is most likely because you are either casting a shared_ptr to a raw pointer. You need to use shared_ptr<>.get() to access the raw pointer. Likewise, you can access the number of players also from the dynamics class directly. Again, apologies for the confusion and if you open a PR to fix these issues I will be much obliged.

aalghooneh commented 1 year ago

thanks! I would be happy to! One last question, is there any plan to release an update to address these issues anytime soon?

dfridovi commented 1 year ago

Lol once your PR lands ;)

dfridovi commented 1 year ago

The backstory on this repository is that it was created during a sprint for a demo that happened in October 2019, and has not been touched since then. The main ilqgames repo was actively developed through fall 2020 and has not seen significant changes since then, apart from a few minor tweaks in fall 2021. Most of our efforts have been focused on other related projects in the Julia language. For an example: https://github.com/lassepe/LiftedTrajectoryGames.jl

aalghooneh commented 1 year ago

oh! Thanks for all the help then David, I will follow up with you