17 from moveit_msgs.srv
import CheckIfRobotStateExistsInWarehouse
as HasState
18 from moveit_msgs.srv
import GetRobotStateFromWarehouse
as GetState
19 from moveit_msgs.msg
import RobotState
20 from moveit_msgs.srv
import SaveRobotStateToWarehouse
as SaveState
21 from moveit_msgs.srv
import ListRobotStatesInWarehouse
as ListState
26 if req.name ==
"state1":
27 resp.joint_state.name = [
"joint_test1",
"joint_test2"]
28 resp.joint_state.position = [1.0, 2.0]
29 if req.name ==
"state2":
30 resp.joint_state.name = [
"joint_test3",
"joint_test4"]
31 resp.joint_state.position = [3.0, 4.0]
40 states = {
"state1",
"state2"}
45 if "state1" in req.name:
50 if __name__ ==
"__main__":
51 rospy.init_node(
'mock_services', anonymous=
True)
52 s1 = rospy.Service(
'/get_robot_state', GetState, mock_get_state_callback)
53 s2 = rospy.Service(
'/has_robot_state', HasState, mock_has_state_callback)
54 s3 = rospy.Service(
'/list_robot_states', ListState, mock_list_state_callback)
55 s4 = rospy.Service(
'/save_robot_state', SaveState, mock_save_state_callback)
def mock_has_state_callback(req)
def mock_get_state_callback(req)
def mock_save_state_callback(req)
def mock_list_state_callback(req)