Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahiminfinite committed Aug 3, 2023
1 parent d8c3be2 commit b1d7b4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 4 additions & 0 deletions moveit_ros/moveit_servo/src/servo_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,13 @@ void ServoNode::servoLoop()
if ((servo_->getStatus() != StatusCode::INVALID))
{
if (servo_params_.command_out_type == "trajectory_msgs/JointTrajectory")
{
trajectory_publisher_->publish(composeTrajectoryMessage(servo_->getParams(), next_joint_state));
}
else if (servo_params_.command_out_type == "std_msgs/Float64MultiArray")
{
multi_array_publisher_->publish(composeMultiArrayMessage(servo_->getParams(), next_joint_state));
}
last_commanded_state_ = next_joint_state;
}

Expand Down
15 changes: 3 additions & 12 deletions moveit_ros/moveit_servo/tests/test_ros_integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ TEST_F(ServoRosFixture, testJointJog)
auto response = switch_input_client_->async_send_request(request);
ASSERT_EQ(response.get()->success, true);

if (state_count_ > 0)
RCLCPP_INFO_STREAM(servo_test_node_->get_logger(), "State available");
else
RCLCPP_INFO_STREAM(servo_test_node_->get_logger(), "state not available");
ASSERT_NE(state_count_, 0);

sensor_msgs::msg::JointState prev_state, curr_state;
{
Expand Down Expand Up @@ -130,10 +127,7 @@ TEST_F(ServoRosFixture, testTwist)
auto response = switch_input_client_->async_send_request(request);
ASSERT_EQ(response.get()->success, true);

if (state_count_ > 0)
RCLCPP_INFO_STREAM(servo_test_node_->get_logger(), "State available");
else
RCLCPP_INFO_STREAM(servo_test_node_->get_logger(), "state not available");
ASSERT_NE(state_count_, 0);

sensor_msgs::msg::JointState prev_state, curr_state;
{
Expand Down Expand Up @@ -193,10 +187,7 @@ TEST_F(ServoRosFixture, testPose)
pose_cmd.pose.orientation.y = 0.0;
pose_cmd.pose.orientation.z = 0.0;

if (state_count_ > 0)
RCLCPP_INFO_STREAM(servo_test_node_->get_logger(), "State available");
else
RCLCPP_INFO_STREAM(servo_test_node_->get_logger(), "state not available");
ASSERT_NE(state_count_, 0);

sensor_msgs::msg::JointState prev_state, curr_state;
{
Expand Down

0 comments on commit b1d7b4a

Please sign in to comment.