Skip to content

Commit d1fb567

Browse files
author
AndyZe
authored
Servo API update (#672)
1 parent 9557290 commit d1fb567

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

doc/examples/realtime_servo/src/servo_cpp_interface_demo.cpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
// ROS
4242
#include <rclcpp/rclcpp.hpp>
4343

44-
// Servo
45-
#include <moveit_servo/servo_parameters.h>
44+
// Auto-generated
45+
#include <moveit_servo_lib_parameters.hpp>
4646
#include <moveit_servo/servo.h>
4747
#include <moveit/planning_scene_monitor/planning_scene_monitor.h>
4848

@@ -166,21 +166,14 @@ int main(int argc, char** argv)
166166

167167
// Initializing Servo
168168
// ^^^^^^^^^^^^^^^^^^
169-
// Servo requires a number of parameters to dictate its behavior. These can be read automatically by using the
170-
// :code:`makeServoParameters` helper function
171-
auto servo_parameters = moveit_servo::ServoParameters::makeServoParameters(node_);
172-
if (!servo_parameters)
173-
{
174-
RCLCPP_FATAL(LOGGER, "Failed to load the servo parameters");
175-
return EXIT_FAILURE;
176-
}
169+
auto servo_param_listener = std::make_unique<const servo::ParamListener>(node_);
177170

178171
// Initialize the Servo C++ interface by passing a pointer to the node, the parameters, and the PSM
179-
auto servo = std::make_unique<moveit_servo::Servo>(node_, servo_parameters, planning_scene_monitor);
172+
moveit_servo::Servo servo(node_, planning_scene_monitor, std::move(servo_param_listener));
180173

181174
// You can start Servo directly using the C++ interface. If launched using the alternative ServoNode, a ROS
182175
// service is used to start Servo. Before it is started, MoveIt Servo will not accept any commands or move the robot
183-
servo->start();
176+
servo.start();
184177

185178
// Sending Commands
186179
// ^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)