9 #include "dynamic_graph_manager/TestUserCmdBool.h" 27 boolean_set_by_user_cmd_ =
false;
55 map[
"encoders"].setRandom();
56 map[
"imu_accelerometer"].setRandom();
57 map[
"imu_gyroscope"].setRandom();
58 map[
"imu"].setRandom();
68 desired_torques_ = map.at(
"torques");
69 desired_positions_ = map.at(
"positions");
80 bool ret = boolean_set_by_user_cmd_;
94 dynamic_graph_manager::TestUserCmdBool::Request& req,
95 dynamic_graph_manager::TestUserCmdBool::Response& res)
101 res.sanity_check =
true;
117 return check || DynamicGraphManager::is_in_safety_mode();
128 for (dynamic_graph::VectorDGMap::iterator ctrl =
133 ctrl->second.fill(0.0);
146 boolean_set_by_user_cmd_ = user_input;
150 std::atomic_bool boolean_set_by_user_cmd_;
153 dynamicgraph::Vector desired_torques_, desired_positions_;
std::deque< ros::ServiceServer > ros_user_commands_
Attribute shared with the daughter class.
Definition: dynamic_graph_manager.hh:772
SimpleDGM()
Construct a new SimpleDGM object.
Definition: simple_dgm.hpp:25
bool user_command_callback(dynamic_graph_manager::TestUserCmdBool::Request &req, dynamic_graph_manager::TestUserCmdBool::Response &res)
This service callback parse the ros messages and register and internal method for further call using ...
Definition: simple_dgm.hpp:93
~SimpleDGM()
Destroy the SimpleDGM object.
Definition: simple_dgm.hpp:32
static const std::string hw_com_ros_node_name_
hw_com_ros_node_name_ this is the ros node name of the harware communication process ...
Definition: dynamic_graph_manager.hh:368
void initialize_hardware_communication_process()
Simple overload doing nothing.
Definition: simple_dgm.hpp:39
std::map< std::string, dynamicgraph::Vector > VectorDGMap
VectorDGMap is a shortcut for the very long type of the map.
Definition: tools.hh:22
this is this package namespace in order to avoid naming conflict
Definition: device.hh:22
This class has for purpose to manage the different processes during run time.
Definition: dynamic_graph_manager.hh:92
void get_sensors_to_map(dynamic_graph::VectorDGMap &map)
Get the sensors to the map object.
Definition: simple_dgm.hpp:53
VectorDGMap motor_controls_map_
motor_controls_map_ is a map of dynamicgraph::Vector.
Definition: dynamic_graph_manager.hh:577
void compute_safety_controls()
compute_safety_controls computes safety controls very fast in case the dynamic graph is taking to muc...
Definition: simple_dgm.hpp:124
void user_command(bool user_input)
The actuall user command called in the real time thread.
Definition: simple_dgm.hpp:143
void set_motor_controls_from_map(const dynamic_graph::VectorDGMap &map)
Set the motor controls from map object to no hardware.
Definition: simple_dgm.hpp:66
bool get_has_user_command_been_executed()
Get the has_user_command_been_executed_ object.
Definition: simple_dgm.hpp:75
bool is_in_safety_mode()
is_in_safety_mode check if the dynamic graph is still alive and sending commands at a descent frequen...
Definition: simple_dgm.hpp:113
This class is a simple dynamic graph manager with a fake hardware interface used for unittesting...
Definition: simple_dgm.hpp:19
DynamicGraphManager()
DynamicGraphManager, constructor of the class.
Definition: dynamic_graph_manager.cpp:34
void add_user_command(std::function< void(void)> func)
Method inherited.
Definition: dynamic_graph_manager.cpp:722
Example of hardware communication client based on ROS.
Definition: simple_dgm.hpp:13
ros::NodeHandle & ros_init(std::string node_name)
rosInit is a global method that uses the structure GlobalRos.
Definition: ros_init.cpp:31