File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
nav2_dwb_controller/dwb_plugins/include/dwb_plugins Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 3737
3838#include < memory>
3939#include < string>
40-
40+ # include < stdexcept >
4141#include " rclcpp/rclcpp.hpp"
4242#include " nav2_util/lifecycle_node.hpp"
4343
@@ -110,10 +110,11 @@ class KinematicsHandler
110110 inline KinematicParameters getKinematics () {
111111 KinematicParameters* ptr = kinematics_.load ();
112112 // Check for nullptr before dereferencing
113- if (ptr != nullptr ) {
114- return *ptr;
113+ if (ptr == nullptr ) {
114+ throw std::runtime_error (
115+ " KinematicsHandler::getKinematics() called before kinematics_ is initialized" );
115116 }
116- return KinematicParameters () ;
117+ return *ptr ;
117118 }
118119
119120 using Ptr = std::shared_ptr<KinematicsHandler>;
You can’t perform that action at this time.
0 commit comments