From 7c29279024b33b9fec2803ddaea9994886f66201 Mon Sep 17 00:00:00 2001 From: Anton Deguet Date: Wed, 27 Dec 2023 16:05:10 -0500 Subject: [PATCH 1/5] gscam for decklink: added deinterlace --- dvrk_video/launch/gscam_decklink.launch | 2 +- dvrk_video/launch/jhu_daVinci_video.launch | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dvrk_video/launch/gscam_decklink.launch b/dvrk_video/launch/gscam_decklink.launch index e33dc051..6f7d1901 100644 --- a/dvrk_video/launch/gscam_decklink.launch +++ b/dvrk_video/launch/gscam_decklink.launch @@ -17,7 +17,7 @@ - + diff --git a/dvrk_video/launch/jhu_daVinci_video.launch b/dvrk_video/launch/jhu_daVinci_video.launch index 76882997..cd8e263d 100644 --- a/dvrk_video/launch/jhu_daVinci_video.launch +++ b/dvrk_video/launch/jhu_daVinci_video.launch @@ -1,3 +1,5 @@ + + From 808f953cd5f169a90943149a474d011d1fc4facf Mon Sep 17 00:00:00 2001 From: Anton Deguet Date: Wed, 27 Dec 2023 16:06:01 -0500 Subject: [PATCH 2/5] console.cpp: added option to publish SUJ potentiometers, using namespace to maintain similar code for ROS 1 and ROS 2 --- .../include/dvrk_utilities/dvrk_console.h | 1 + dvrk_robot/src/dvrk_console.cpp | 265 ++++++++++-------- dvrk_robot/src/dvrk_console_json.cpp | 9 +- 3 files changed, 161 insertions(+), 114 deletions(-) diff --git a/dvrk_robot/include/dvrk_utilities/dvrk_console.h b/dvrk_robot/include/dvrk_utilities/dvrk_console.h index bbf288db..d41386c5 100644 --- a/dvrk_robot/include/dvrk_utilities/dvrk_console.h +++ b/dvrk_robot/include/dvrk_utilities/dvrk_console.h @@ -74,6 +74,7 @@ namespace dvrk { // buttons on PSM void add_topics_psm_io(const std::string & _arm_name, const std::string & _io_component_name); + void add_topics_suj_voltages(void); void add_topics_teleop_ecm(const std::string & _name); void add_topics_teleop_psm(const std::string & _name); diff --git a/dvrk_robot/src/dvrk_console.cpp b/dvrk_robot/src/dvrk_console.cpp index c779e55c..ce330a27 100644 --- a/dvrk_robot/src/dvrk_console.cpp +++ b/dvrk_robot/src/dvrk_console.cpp @@ -29,6 +29,14 @@ no warranty. The complete license can be found in license.txt and #include +// explicitely list namespaces for messages so code can look the same in ROS 1 and ROS 2 +using namespace std_msgs; +using namespace geometry_msgs; +using namespace sensor_msgs; +using namespace diagnostic_msgs; +using namespace cisst_msgs; +using namespace crtk_msgs; + const std::string bridgeNamePrefix = "dVRKIOBridge_"; CMN_IMPLEMENT_SERVICES(dvrk_console); @@ -134,7 +142,7 @@ dvrk::console::console(const std::string & name, // replace +/- by strings cmnStringReplaceAll(lowerName, "-", "_minus"); cmnStringReplaceAll(lowerName, "+", "_plus"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (requiredInterfaceName, "Button", footPedalsNameSpace + lowerName); componentManager->Connect(events_bridge().GetName(), requiredInterfaceName, @@ -197,39 +205,38 @@ void dvrk::console::bridge_interface_provided_arm(const std::string & _arm_name, // bridged (e.g. subscribers and events) const std::string _required_interface_name = _arm_name + "_using_" + _interface_name; - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "set_base_frame", _arm_name + "/set_base_frame"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "trajectory_j/set_ratio", _arm_name + "/trajectory_j/set_ratio"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "trajectory_j/set_ratio_v", _arm_name + "/trajectory_j/set_ratio_v"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "trajectory_j/set_ratio_a", _arm_name + "/trajectory_j/set_ratio_a"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "body/set_cf_orientation_absolute", _arm_name + "/body/set_cf_orientation_absolute"); - subscribers_bridge().AddServiceFromCommandQualifiedRead + subscribers_bridge().AddServiceFromCommandQualifiedRead (_required_interface_name, "actuator_to_joint_position", _arm_name + "/actuator_to_joint_position"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "desired_state", _arm_name + "/desired_state"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "goal_reached", _arm_name + "/goal_reached"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "trajectory_j/ratio", _arm_name + "/trajectory_j/ratio"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "trajectory_j/ratio_v", _arm_name + "/trajectory_j/ratio_v"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "trajectory_j/ratio_a", _arm_name + "/trajectory_j/ratio_a"); } @@ -250,14 +257,14 @@ void dvrk::console::bridge_interface_provided_ecm(const std::string & _arm_name, // bridged (e.g. subscribers and events) const std::string _required_interface_name = _arm_name + "_using_" + _interface_name; - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "set_endoscope_type", _arm_name + "/set_endoscope_type"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "endoscope_type", _arm_name + "/endoscope_type"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "ManipClutch", _arm_name + "/manip_clutch"); } @@ -278,20 +285,20 @@ void dvrk::console::bridge_interface_provided_mtm(const std::string & _arm_name, // bridged (e.g. subscribers and events) const std::string _required_interface_name = _arm_name + "_using_" + _interface_name; - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "lock_orientation", _arm_name + "/lock_orientation"); subscribers_bridge().AddSubscriberToCommandVoid (_required_interface_name, "unlock_orientation", _arm_name + "/unlock_orientation"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "orientation_locked", _arm_name + "/orientation_locked"); events_bridge().AddPublisherFromEventVoid (_required_interface_name, "gripper/pinch", _arm_name + "/gripper/pinch"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "gripper/closed", _arm_name + "/gripper/closed"); } @@ -312,23 +319,23 @@ void dvrk::console::bridge_interface_provided_psm(const std::string & _arm_name, // bridged (e.g. subscribers and events) const std::string _required_interface_name = _arm_name + "_using_" + _interface_name; - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "emulate_adapter_present", _arm_name + "/emulate_adapter_present"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "emulate_tool_present", _arm_name + "/emulate_tool_present"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_required_interface_name, "set_tool_type", _arm_name + "/set_tool_type"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "ManipClutch", _arm_name + "/manip_clutch"); events_bridge().AddPublisherFromEventVoid (_required_interface_name, "tool_type_request", _arm_name + "/tool_type_request"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_required_interface_name, "tool_type", _arm_name + "/tool_type"); } @@ -346,71 +353,71 @@ void dvrk::console::add_topics_console(void) subscribers_bridge().AddSubscriberToCommandVoid ("Console", "home", _ros_namespace + "home"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "teleop_enable", _ros_namespace + "teleop/enable"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite ("Console", "teleop_enabled", _ros_namespace + "teleop/enabled"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "cycle_teleop_psm_by_mtm", _ros_namespace + "teleop/cycle_teleop_psm_by_mtm"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "select_teleop_psm", _ros_namespace + "teleop/select_teleop_psm"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "set_scale", _ros_namespace + "teleop/set_scale"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite ("Console", "scale", - _ros_namespace + "/teleop/scale"); - events_bridge().AddPublisherFromEventWrite + _ros_namespace + "teleop/scale"); + events_bridge().AddPublisherFromEventWrite ("Console", "teleop_psm_selected", - _ros_namespace + "/teleop/teleop_psm_selected"); - events_bridge().AddPublisherFromEventWrite + _ros_namespace + "teleop/teleop_psm_selected"); + events_bridge().AddPublisherFromEventWrite ("Console", "teleop_psm_unselected", - _ros_namespace + "/teleop/teleop_psm_unselected"); + _ros_namespace + "teleop/teleop_psm_unselected"); - events_bridge().AddSubscriberToCommandWrite + events_bridge().AddSubscriberToCommandWrite ("Console", "set_volume", - _ros_namespace + "/set_volume"); - events_bridge().AddPublisherFromEventWrite + _ros_namespace + "set_volume"); + events_bridge().AddPublisherFromEventWrite ("Console", "volume", - _ros_namespace + "/volume"); - events_bridge().AddSubscriberToCommandWrite + _ros_namespace + "volume"); + events_bridge().AddSubscriberToCommandWrite ("Console", "beep", - _ros_namespace + "/beep"); - events_bridge().AddSubscriberToCommandWrite + _ros_namespace + "beep"); + events_bridge().AddSubscriberToCommandWrite ("Console", "string_to_speech", - _ros_namespace + "/string_to_speech"); + _ros_namespace + "string_to_speech"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite ("ConsoleOperatorPresent", "Button", - _ros_namespace + "/operator_present"); + _ros_namespace + "operator_present"); m_connections.Add(events_bridge().GetName(), "ConsoleOperatorPresent", m_console->GetName(), "OperatorPresent"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite ("ConsoleClutch", "Button", - _ros_namespace + "/clutch"); + _ros_namespace + "clutch"); m_connections.Add(events_bridge().GetName(), "ConsoleClutch", m_console->GetName(), "Clutch"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite ("ConsoleCamera", "Button", - _ros_namespace + "/camera"); + _ros_namespace + "camera"); m_connections.Add(events_bridge().GetName(), "ConsoleCamera", m_console->GetName(), "Camera"); - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "emulate_operator_present", - _ros_namespace + "/emulate_operator_present"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "emulate_operator_present"); + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "emulate_clutch", - _ros_namespace + "/emulate_clutch"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "emulate_clutch"); + subscribers_bridge().AddSubscriberToCommandWrite ("Console", "emulate_camera", - _ros_namespace + "/emulate_camera"); + _ros_namespace + "emulate_camera"); m_connections.Add(subscribers_bridge().GetName(), "Console", m_console->GetName(), "Main"); @@ -424,26 +431,26 @@ void dvrk::console::add_topics_endoscope_focus(void) const std::string _focus_component_name = m_console->mDaVinciEndoscopeFocus->GetName(); // events - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_focus_component_name, "locked", - _ros_namespace + "/locked"); - events_bridge().AddPublisherFromEventWrite + _ros_namespace + "locked"); + events_bridge().AddPublisherFromEventWrite (_focus_component_name, "focusing_in", - _ros_namespace + "/focusing_in"); - events_bridge().AddPublisherFromEventWrite + _ros_namespace + "focusing_in"); + events_bridge().AddPublisherFromEventWrite (_focus_component_name, "focusing_out", - _ros_namespace + "/focusing_out"); + _ros_namespace + "focusing_out"); // commands - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite (_focus_component_name, "lock", - _ros_namespace + "/lock"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "lock"); + subscribers_bridge().AddSubscriberToCommandWrite (_focus_component_name, "focus_in", - _ros_namespace + "/focus_in"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "focus_in"); + subscribers_bridge().AddSubscriberToCommandWrite (_focus_component_name, "focus_out", - _ros_namespace + "/focus_out"); + _ros_namespace + "focus_out"); m_connections.Add(subscribers_bridge().GetName(), _focus_component_name, _focus_component_name, "Control"); @@ -454,13 +461,13 @@ void dvrk::console::add_topics_endoscope_focus(void) void dvrk::console::add_topics_io(void) { const std::string _ros_namespace = "stats/io/"; - m_pub_bridge->AddPublisherFromCommandRead + m_pub_bridge->AddPublisherFromCommandRead ("io", "period_statistics", _ros_namespace + "period_statistics"); - m_pub_bridge->AddPublisherFromCommandRead + m_pub_bridge->AddPublisherFromCommandRead ("io", "period_statistics_read", _ros_namespace + "period_statistics_read"); - m_pub_bridge->AddPublisherFromCommandRead + m_pub_bridge->AddPublisherFromCommandRead ("io", "period_statistics_write", _ros_namespace + "period_statistics_write"); @@ -489,25 +496,25 @@ void dvrk::console::add_topics_arm_io(mtsROSBridge * _pub_bridge, { const std::string _ros_namespace = _arm_name + "/io/"; const std::string _interface_name = _arm_name + "-io"; - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "pot/measured_js", _ros_namespace + "pot/measured_js"); - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "measured_js", _ros_namespace + "actuator/measured_js"); - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "software/measured_js", _ros_namespace + "software/measured_js"); - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "firmware/measured_js", _ros_namespace + "firmware/measured_js"); - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "GetActuatorFeedbackCurrent", _ros_namespace + "actuator/measured_current"); - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "GetActuatorRequestedCurrent", _ros_namespace + "actuator/servo_current"); - _pub_bridge->AddPublisherFromCommandRead + _pub_bridge->AddPublisherFromCommandRead (_interface_name, "GetActuatorTimestamp", _ros_namespace + "timestamp"); @@ -524,7 +531,7 @@ void dvrk::console::add_topics_ecm_io(const std::string & _arm_name, {"SUJClutch", "suj_clutch"}}); for (auto event : events) { std::string _interface_name = _arm_name + "-" + event.first; - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_interface_name, "Button", _arm_name + "/io/" + event.second); m_connections.Add(events_bridge().GetName(), _interface_name, _io_component_name, _interface_name); @@ -542,17 +549,42 @@ void dvrk::console::add_topics_psm_io(const std::string & _arm_name, {"Tool", "tool"}}); for (auto event : events) { std::string _interface_name = _arm_name + "-" + event.first; - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite (_interface_name, "Button", _arm_name + "/io/" + event.second); m_connections.Add(events_bridge().GetName(), _interface_name, _io_component_name, _interface_name); } } +void dvrk::console::add_topics_suj_voltages(void) +{ + mtsManagerLocal * _component_manager = mtsManagerLocal::GetInstance(); + mtsComponent * _suj = _component_manager->GetComponent("SUJ"); + if (!_suj) { + CMN_LOG_CLASS_INIT_WARNING << "add_topics_suj_voltages: no SUJ on this console! option -s ignored!" << std::endl; + return; + } + mtsROSBridge * _pub_bridge = new mtsROSBridge("SUJ-Voltages", 0.01 * cmn_s, + node_handle_ptr()); + const auto arms = std::list({"ECM", "PSM1", "PSM2", "PSM3"}); + for (auto arm : arms) { + _pub_bridge->AddPublisherFromCommandRead + ("SUJ-" + arm, "GetVoltagesPrimary", + "SUJ/" + arm + "/primary_voltage"); + _pub_bridge->AddPublisherFromCommandRead + ("SUJ-" + arm, "GetVoltagesSecondary", + "SUJ/" + arm + "/secondary_voltage"); + m_connections.Add(_pub_bridge->GetName(), "SUJ-" + arm, + "SUJ", arm); + } + _component_manager->AddComponent(_pub_bridge); +} + void dvrk::console::add_topics_teleop_ecm(const std::string & _name) { std::string _ros_namespace = _name; cisst_ros_crtk::clean_namespace(_ros_namespace); + _ros_namespace += "/"; // messages events_bridge().AddLogFromEventWrite(_name + "-log", "error", @@ -566,22 +598,25 @@ void dvrk::console::add_topics_teleop_ecm(const std::string & _name) _name, "Setting"); // events - events_bridge().AddPublisherFromEventWrite - (_name, "desired_state", _ros_namespace + "/desired_state"); - events_bridge().AddPublisherFromEventWrite - (_name, "current_state", _ros_namespace + "/current_state"); - events_bridge().AddPublisherFromEventWrite - (_name, "scale", _ros_namespace + "/scale"); - events_bridge().AddPublisherFromEventWrite - (_name, "following", _ros_namespace + "/following"); + events_bridge().AddPublisherFromEventWrite + (_name, "desired_state", _ros_namespace + "desired_state"); + events_bridge().AddPublisherFromEventWrite + (_name, "current_state", _ros_namespace + "current_state"); + events_bridge().AddPublisherFromEventWrite + (_name, "scale", _ros_namespace + "scale"); + events_bridge().AddPublisherFromEventWrite + (_name, "following", _ros_namespace + "following"); // connect m_connections.Add(events_bridge().GetName(), _name, _name, "Setting"); // commands - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite + (_name, "state_command", + _ros_namespace + "state_command"); + subscribers_bridge().AddSubscriberToCommandWrite (_name, "set_scale", - _ros_namespace + "/set_scale"); + _ros_namespace + "set_scale"); // connect m_connections.Add(subscribers_bridge().GetName(), _name, _name, "Setting"); @@ -591,6 +626,7 @@ void dvrk::console::add_topics_teleop_psm(const std::string & _name) { std::string _ros_namespace = _name; cisst_ros_crtk::clean_namespace(_ros_namespace); + _ros_namespace += "/"; // messages events_bridge().AddLogFromEventWrite(_name + "-log", "error", @@ -604,47 +640,50 @@ void dvrk::console::add_topics_teleop_psm(const std::string & _name) _name, "Setting"); // publisher - m_pub_bridge->AddPublisherFromCommandRead + m_pub_bridge->AddPublisherFromCommandRead (_name, "alignment_offset", - _ros_namespace + "/alignment_offset"); + _ros_namespace + "alignment_offset"); // connect m_connections.Add(m_pub_bridge->GetName(), _name, _name, "Setting"); // events - events_bridge().AddPublisherFromEventWrite - (_name, "desired_state", _ros_namespace + "/desired_state"); - events_bridge().AddPublisherFromEventWrite - (_name, "current_state", _ros_namespace + "/current_state"); - events_bridge().AddPublisherFromEventWrite + events_bridge().AddPublisherFromEventWrite + (_name, "desired_state", _ros_namespace + "desired_state"); + events_bridge().AddPublisherFromEventWrite + (_name, "current_state", _ros_namespace + "current_state"); + events_bridge().AddPublisherFromEventWrite (_name, "rotation_locked", - _ros_namespace + "/rotation_locked"); - events_bridge().AddPublisherFromEventWrite + _ros_namespace + "rotation_locked"); + events_bridge().AddPublisherFromEventWrite (_name, "translation_locked", - _ros_namespace + "/translation_locked"); - events_bridge().AddPublisherFromEventWrite - (_name, "scale", _ros_namespace + "/scale"); - events_bridge().AddPublisherFromEventWrite - (_name, "following", _ros_namespace + "/following"); - events_bridge().AddPublisherFromEventWrite - (_name, "align_mtm", _ros_namespace + "/align_mtm"); + _ros_namespace + "translation_locked"); + events_bridge().AddPublisherFromEventWrite + (_name, "scale", _ros_namespace + "scale"); + events_bridge().AddPublisherFromEventWrite + (_name, "following", _ros_namespace + "following"); + events_bridge().AddPublisherFromEventWrite + (_name, "align_mtm", _ros_namespace + "align_mtm"); // connect m_connections.Add(events_bridge().GetName(), _name, _name, "Setting"); // commands - subscribers_bridge().AddSubscriberToCommandWrite + subscribers_bridge().AddSubscriberToCommandWrite + (_name, "state_command", + _ros_namespace + "state_command"); + subscribers_bridge().AddSubscriberToCommandWrite (_name, "lock_translation", - _ros_namespace + "/lock_translation"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "lock_translation"); + subscribers_bridge().AddSubscriberToCommandWrite (_name, "lock_rotation", - _ros_namespace + "/lock_rotation"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "lock_rotation"); + subscribers_bridge().AddSubscriberToCommandWrite (_name, "set_scale", - _ros_namespace + "/set_scale"); - subscribers_bridge().AddSubscriberToCommandWrite + _ros_namespace + "set_scale"); + subscribers_bridge().AddSubscriberToCommandWrite (_name, "set_align_mtm", - _ros_namespace + "/set_align_mtm"); + _ros_namespace + "set_align_mtm"); // connect m_connections.Add(subscribers_bridge().GetName(), _name, _name, "Setting"); diff --git a/dvrk_robot/src/dvrk_console_json.cpp b/dvrk_robot/src/dvrk_console_json.cpp index 9b161a7d..befaeaa0 100644 --- a/dvrk_robot/src/dvrk_console_json.cpp +++ b/dvrk_robot/src/dvrk_console_json.cpp @@ -98,6 +98,9 @@ int main(int argc, char ** argv) "json config file to configure ROS bridges to collect low level data (IO)", cmnCommandLineOptions::OPTIONAL_OPTION, &jsonIOConfigFiles); + options.AddOptionNoValue("s", "suj-voltages", + "add ROS topics for SUJ voltages"); + options.AddOptionNoValue("I", "pid-topics", "add some extra publishers to monitor PID state"); @@ -109,7 +112,7 @@ int main(int argc, char ** argv) cmnCommandLineOptions::OPTIONAL_OPTION, &jsonCollectionConfigFile); options.AddOptionNoValue("C", "calibration-mode", - "run in calibration mode, doesn't use potentiometers to monitor encoder values and always force re-homing. This mode should only be used when calibrating your potentiometers."); + "run in calibration mode, doesn't use potentiometers to monitor encoder values and always force re-homing. This mode should only be used when calibrating your potentiometers"); options.AddOptionMultipleValues("m", "component-manager", "JSON files to configure component manager", @@ -208,6 +211,10 @@ int main(int argc, char ** argv) consoleROS->Configure(*iter); } + if (options.IsSet("suj-voltages")) { + consoleROS->add_topics_suj_voltages(); + } + if (options.IsSet("pid-topics")) { consoleROS->add_topics_pid(); } From 19ad66e241cdcb47c16c43224160deb11556a7f5 Mon Sep 17 00:00:00 2001 From: Anton Deguet Date: Thu, 28 Dec 2023 17:42:07 -0500 Subject: [PATCH 3/5] Updated CHANGELOG, CMake and package.xml for 2.2.1 + added 2.2.1 VCS file --- CHANGELOG.md | 12 ++++ dvrk-2.2.1.vcs | 61 ++++++++++++++++++++ dvrk_arms_from_ros/components/CMakeLists.txt | 5 +- dvrk_arms_from_ros/components/package.xml | 2 +- dvrk_hrsv_widget/CMakeLists.txt | 4 +- dvrk_hrsv_widget/package.xml | 2 +- dvrk_model/CMakeLists.txt | 4 +- dvrk_model/package.xml | 2 +- dvrk_python/CMakeLists.txt | 4 +- dvrk_python/package.xml | 2 +- dvrk_robot/CMakeLists.txt | 4 +- dvrk_robot/package.xml | 2 +- dvrk_video/CMakeLists.txt | 4 +- dvrk_video/package.xml | 2 +- 14 files changed, 91 insertions(+), 19 deletions(-) create mode 100644 dvrk-2.2.1.vcs diff --git a/CHANGELOG.md b/CHANGELOG.md index b399041c..ff6ceac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ Change log ========== +2.2.1 (2023-12-29) +================== + +* API changes: + * Add `deinterlace` for gscam launch for DeckLink cards +* Deprecated features: + * None +* New features: + * Added `-s` to publish raw voltages for SUJs +* Bug fixes: + * None + 2.2.0 (2023-11-21) ================== diff --git a/dvrk-2.2.1.vcs b/dvrk-2.2.1.vcs new file mode 100644 index 00000000..e642452d --- /dev/null +++ b/dvrk-2.2.1.vcs @@ -0,0 +1,61 @@ +repositories: + cisst-saw/cisstNetlib: + type: git + url: https://github.com/jhu-cisst/cisstNetlib.git + version: 3.2.0 + cisst-saw/cisst: + type: git + url: https://github.com/jhu-cisst/cisst.git + version: 1.2.1 + cisst-saw/cisst-ros: + type: git + url: https://github.com/jhu-cisst/cisst-ros.git + version: 2.2.0 + cisst-saw/sawKeyboard: + type: git + url: https://github.com/jhu-saw/sawKeyboard.git + version: 1.4.0 + cisst-saw/sawTextToSpeech: + type: git + url: https://github.com/jhu-saw/sawTextToSpeech.git + version: 1.4.0 + cisst-saw/sawRobotIO1394: + type: git + url: https://github.com/jhu-saw/sawRobotIO1394.git + version: 2.2.1 + cisst-saw/sawControllers: + type: git + url: https://github.com/jhu-saw/sawControllers.git + version: 2.1.0 + cisst-saw/sawIntuitiveResearchKit: + type: git + url: https://github.com/jhu-dvrk/sawIntuitiveResearchKit.git + version: 2.2.1 + crtk/crtk_msgs: + type: git + url: https://github.com/collaborative-robotics/crtk_msgs.git + version: 1.1.0 + crtk/crtk_python_client: + type: git + url: https://github.com/collaborative-robotics/crtk_python_client.git + version: 1.2.0 + crtk/crtk_matlab_client: + type: git + url: https://github.com/collaborative-robotics/crtk_matlab_client.git + version: 1.2.0 + dvrk/dvrk-ros: + type: git + url: https://github.com/jhu-dvrk/dvrk-ros.git + version: 2.2.1 + dvrk/dvrk-gravity-compensation: + type: git + url: https://github.com/jhu-dvrk/dvrk-gravity-compensation.git + version: 2.0.0 + dvrk/dvrk_config_jhu: + type: git + url: https://github.com/jhu-dvrk/dvrk_config_jhu.git + version: 2.2.1 + dvrk/dESSJ-firmware: + type: git + url: https://github.com/jhu-dvrk/dESSJ-firmware.git + version: 1.0.0 diff --git a/dvrk_arms_from_ros/components/CMakeLists.txt b/dvrk_arms_from_ros/components/CMakeLists.txt index 52d4dc6c..6381c294 100644 --- a/dvrk_arms_from_ros/components/CMakeLists.txt +++ b/dvrk_arms_from_ros/components/CMakeLists.txt @@ -9,14 +9,13 @@ # # --- end cisst license --- -cmake_minimum_required (VERSION 3.1) +cmake_minimum_required (VERSION 3.10) +project (dvrk_arms_from_ros VERSION 2.2.1) set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_EXTENSIONS OFF) -project (dvrk_arms_from_ros VERSION 2.2.0) - ## find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages diff --git a/dvrk_arms_from_ros/components/package.xml b/dvrk_arms_from_ros/components/package.xml index cdd1c06c..71398546 100644 --- a/dvrk_arms_from_ros/components/package.xml +++ b/dvrk_arms_from_ros/components/package.xml @@ -1,6 +1,6 @@ dvrk_arms_from_ros - 2.2.0 + 2.2.1 sawIntuitiveResearchKit compatible arm from ROS topics diff --git a/dvrk_hrsv_widget/CMakeLists.txt b/dvrk_hrsv_widget/CMakeLists.txt index 83735448..8d27ca51 100644 --- a/dvrk_hrsv_widget/CMakeLists.txt +++ b/dvrk_hrsv_widget/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 3.1) -project (dvrk_hrsv_widget VERSION 2.2.0) +cmake_minimum_required (VERSION 3.10) +project (dvrk_hrsv_widget VERSION 2.2.1) set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/dvrk_hrsv_widget/package.xml b/dvrk_hrsv_widget/package.xml index 4431946b..b57c00aa 100644 --- a/dvrk_hrsv_widget/package.xml +++ b/dvrk_hrsv_widget/package.xml @@ -1,7 +1,7 @@ dvrk_hrsv_widget - 2.2.0 + 2.2.1 dVRK HRSV widget Anton Deguet diff --git a/dvrk_model/CMakeLists.txt b/dvrk_model/CMakeLists.txt index c84fce4e..63bec44f 100644 --- a/dvrk_model/CMakeLists.txt +++ b/dvrk_model/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) -project(dvrk_model VERSION 2.1.0) +cmake_minimum_required(VERSION 3.10) +project(dvrk_model VERSION 2.2.1) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) diff --git a/dvrk_model/package.xml b/dvrk_model/package.xml index 993fc465..415544ec 100644 --- a/dvrk_model/package.xml +++ b/dvrk_model/package.xml @@ -1,7 +1,7 @@ dvrk_model - 2.2.0 + 2.2.1 The dvrk_model package Anton Deguet diff --git a/dvrk_python/CMakeLists.txt b/dvrk_python/CMakeLists.txt index 2b84f099..9528e238 100644 --- a/dvrk_python/CMakeLists.txt +++ b/dvrk_python/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 3.1) -project (dvrk_python VERSION 2.2.0) +cmake_minimum_required (VERSION 3.10) +project (dvrk_python VERSION 2.2.1) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) diff --git a/dvrk_python/package.xml b/dvrk_python/package.xml index 3250c1c8..c69c9874 100644 --- a/dvrk_python/package.xml +++ b/dvrk_python/package.xml @@ -1,7 +1,7 @@ dvrk_python - 2.2.0 + 2.2.1 The dVRK Python package Anton Deguet diff --git a/dvrk_robot/CMakeLists.txt b/dvrk_robot/CMakeLists.txt index 5ecd8b1a..b2a0e112 100644 --- a/dvrk_robot/CMakeLists.txt +++ b/dvrk_robot/CMakeLists.txt @@ -9,8 +9,8 @@ # # --- end cisst license --- -cmake_minimum_required (VERSION 3.1) -project (dvrk_robot VERSION 2.2.0) +cmake_minimum_required (VERSION 3.10) +project (dvrk_robot VERSION 2.2.1) set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/dvrk_robot/package.xml b/dvrk_robot/package.xml index 859d4d57..1bf00ac5 100644 --- a/dvrk_robot/package.xml +++ b/dvrk_robot/package.xml @@ -1,7 +1,7 @@ dvrk_robot - 2.2.0 + 2.2.1 The dvrk_robot package Anton Deguet diff --git a/dvrk_video/CMakeLists.txt b/dvrk_video/CMakeLists.txt index 39aff686..5bd02bf0 100644 --- a/dvrk_video/CMakeLists.txt +++ b/dvrk_video/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 3.1) -project (dvrk_video VERSION 2.2.0) +cmake_minimum_required (VERSION 3.10) +project (dvrk_video VERSION 2.2.1) find_package ( catkin REQUIRED diff --git a/dvrk_video/package.xml b/dvrk_video/package.xml index a1af6950..04fd942e 100644 --- a/dvrk_video/package.xml +++ b/dvrk_video/package.xml @@ -1,7 +1,7 @@ dvrk_video - 2.2.0 + 2.2.1 The dVRK video package Anton Deguet From d799ef21adb95401ae6f234dd3cb781e20258005 Mon Sep 17 00:00:00 2001 From: Anton Deguet Date: Fri, 29 Dec 2023 13:36:15 -0500 Subject: [PATCH 4/5] Removed all vcs files, now moved to https://github.com/jhu-dvrk/dvrk-github-workflow --- dvrk-2.1.vcs | 53 ------------------------------------------- dvrk-2.2.1.vcs | 61 -------------------------------------------------- dvrk-2.2.vcs | 61 -------------------------------------------------- dvrk-devel.vcs | 61 -------------------------------------------------- 4 files changed, 236 deletions(-) delete mode 100644 dvrk-2.1.vcs delete mode 100644 dvrk-2.2.1.vcs delete mode 100644 dvrk-2.2.vcs delete mode 100644 dvrk-devel.vcs diff --git a/dvrk-2.1.vcs b/dvrk-2.1.vcs deleted file mode 100644 index 93ff69de..00000000 --- a/dvrk-2.1.vcs +++ /dev/null @@ -1,53 +0,0 @@ -repositories: - cisst-saw/cisstNetlib: - type: git - url: https://github.com/jhu-cisst/cisstNetlib.git - version: 3.0.0 - cisst-saw/cisst: - type: git - url: https://github.com/jhu-cisst/cisst.git - version: 1.1.0 - cisst-saw/cisst-ros: - type: git - url: https://github.com/jhu-cisst/cisst-ros.git - version: 2.0.0 - cisst-saw/sawKeyboard: - type: git - url: https://github.com/jhu-saw/sawKeyboard.git - version: 1.3.0 - cisst-saw/sawTextToSpeech: - type: git - url: https://github.com/jhu-saw/sawTextToSpeech.git - version: 1.3.0 - cisst-saw/sawRobotIO1394: - type: git - url: https://github.com/jhu-saw/sawRobotIO1394.git - version: 2.1.0 - cisst-saw/sawControllers: - type: git - url: https://github.com/jhu-saw/sawControllers.git - version: 2.0.0 - cisst-saw/sawIntuitiveResearchKit: - type: git - url: https://github.com/jhu-dvrk/sawIntuitiveResearchKit.git - version: 2.1.0 - crtk/crtk_msgs: - type: git - url: https://github.com/collaborative-robotics/crtk_msgs.git - version: 1.0.0 - crtk/crtk_python_client: - type: git - url: https://github.com/collaborative-robotics/crtk_python_client.git - version: 1.1.0 - crtk/crtk_matlab_client: - type: git - url: https://github.com/collaborative-robotics/crtk_matlab_client.git - version: 1.1.0 - dvrk/dvrk-ros: - type: git - url: https://github.com/jhu-dvrk/dvrk-ros.git - version: 2.1.0 - dvrk/dvrk-gravity-compensation: - type: git - url: https://github.com/jhu-dvrk/dvrk-gravity-compensation.git - version: 2.0.0 diff --git a/dvrk-2.2.1.vcs b/dvrk-2.2.1.vcs deleted file mode 100644 index e642452d..00000000 --- a/dvrk-2.2.1.vcs +++ /dev/null @@ -1,61 +0,0 @@ -repositories: - cisst-saw/cisstNetlib: - type: git - url: https://github.com/jhu-cisst/cisstNetlib.git - version: 3.2.0 - cisst-saw/cisst: - type: git - url: https://github.com/jhu-cisst/cisst.git - version: 1.2.1 - cisst-saw/cisst-ros: - type: git - url: https://github.com/jhu-cisst/cisst-ros.git - version: 2.2.0 - cisst-saw/sawKeyboard: - type: git - url: https://github.com/jhu-saw/sawKeyboard.git - version: 1.4.0 - cisst-saw/sawTextToSpeech: - type: git - url: https://github.com/jhu-saw/sawTextToSpeech.git - version: 1.4.0 - cisst-saw/sawRobotIO1394: - type: git - url: https://github.com/jhu-saw/sawRobotIO1394.git - version: 2.2.1 - cisst-saw/sawControllers: - type: git - url: https://github.com/jhu-saw/sawControllers.git - version: 2.1.0 - cisst-saw/sawIntuitiveResearchKit: - type: git - url: https://github.com/jhu-dvrk/sawIntuitiveResearchKit.git - version: 2.2.1 - crtk/crtk_msgs: - type: git - url: https://github.com/collaborative-robotics/crtk_msgs.git - version: 1.1.0 - crtk/crtk_python_client: - type: git - url: https://github.com/collaborative-robotics/crtk_python_client.git - version: 1.2.0 - crtk/crtk_matlab_client: - type: git - url: https://github.com/collaborative-robotics/crtk_matlab_client.git - version: 1.2.0 - dvrk/dvrk-ros: - type: git - url: https://github.com/jhu-dvrk/dvrk-ros.git - version: 2.2.1 - dvrk/dvrk-gravity-compensation: - type: git - url: https://github.com/jhu-dvrk/dvrk-gravity-compensation.git - version: 2.0.0 - dvrk/dvrk_config_jhu: - type: git - url: https://github.com/jhu-dvrk/dvrk_config_jhu.git - version: 2.2.1 - dvrk/dESSJ-firmware: - type: git - url: https://github.com/jhu-dvrk/dESSJ-firmware.git - version: 1.0.0 diff --git a/dvrk-2.2.vcs b/dvrk-2.2.vcs deleted file mode 100644 index 9bce5bb0..00000000 --- a/dvrk-2.2.vcs +++ /dev/null @@ -1,61 +0,0 @@ -repositories: - cisst-saw/cisstNetlib: - type: git - url: https://github.com/jhu-cisst/cisstNetlib.git - version: 3.1.0 - cisst-saw/cisst: - type: git - url: https://github.com/jhu-cisst/cisst.git - version: 1.2.0 - cisst-saw/cisst-ros: - type: git - url: https://github.com/jhu-cisst/cisst-ros.git - version: 2.1.0 - cisst-saw/sawKeyboard: - type: git - url: https://github.com/jhu-saw/sawKeyboard.git - version: 1.4.0 - cisst-saw/sawTextToSpeech: - type: git - url: https://github.com/jhu-saw/sawTextToSpeech.git - version: 1.4.0 - cisst-saw/sawRobotIO1394: - type: git - url: https://github.com/jhu-saw/sawRobotIO1394.git - version: 2.2.0 - cisst-saw/sawControllers: - type: git - url: https://github.com/jhu-saw/sawControllers.git - version: 2.1.0 - cisst-saw/sawIntuitiveResearchKit: - type: git - url: https://github.com/jhu-dvrk/sawIntuitiveResearchKit.git - version: 2.2.0 - crtk/crtk_msgs: - type: git - url: https://github.com/collaborative-robotics/crtk_msgs.git - version: 1.1.0 - crtk/crtk_python_client: - type: git - url: https://github.com/collaborative-robotics/crtk_python_client.git - version: 1.2.0 - crtk/crtk_matlab_client: - type: git - url: https://github.com/collaborative-robotics/crtk_matlab_client.git - version: 1.2.0 - dvrk/dvrk-ros: - type: git - url: https://github.com/jhu-dvrk/dvrk-ros.git - version: 2.2.0 - dvrk/dvrk-gravity-compensation: - type: git - url: https://github.com/jhu-dvrk/dvrk-gravity-compensation.git - version: 2.0.0 - dvrk/dvrk_config_jhu: - type: git - url: https://github.com/jhu-dvrk/dvrk_config_jhu.git - version: 2.2.0 - dvrk/dESSJ-firmware: - type: git - url: https://github.com/jhu-dvrk/dESSJ-firmware.git - version: 1.0.0 diff --git a/dvrk-devel.vcs b/dvrk-devel.vcs deleted file mode 100644 index 41e19044..00000000 --- a/dvrk-devel.vcs +++ /dev/null @@ -1,61 +0,0 @@ -repositories: - cisst-saw/cisstNetlib: - type: git - url: https://github.com/jhu-cisst/cisstNetlib.git - version: devel - cisst-saw/cisst: - type: git - url: https://github.com/jhu-cisst/cisst.git - version: devel - cisst-saw/cisst-ros: - type: git - url: https://github.com/jhu-cisst/cisst-ros.git - version: devel - cisst-saw/sawKeyboard: - type: git - url: https://github.com/jhu-saw/sawKeyboard.git - version: devel - cisst-saw/sawTextToSpeech: - type: git - url: https://github.com/jhu-saw/sawTextToSpeech.git - version: devel - cisst-saw/sawRobotIO1394: - type: git - url: https://github.com/jhu-saw/sawRobotIO1394.git - version: devel - cisst-saw/sawControllers: - type: git - url: https://github.com/jhu-saw/sawControllers.git - version: devel - cisst-saw/sawIntuitiveResearchKit: - type: git - url: https://github.com/jhu-dvrk/sawIntuitiveResearchKit.git - version: devel - crtk/crtk_msgs: - type: git - url: https://github.com/collaborative-robotics/crtk_msgs.git - version: devel - crtk/crtk_python_client: - type: git - url: https://github.com/collaborative-robotics/crtk_python_client.git - version: devel - crtk/crtk_matlab_client: - type: git - url: https://github.com/collaborative-robotics/crtk_matlab_client.git - version: devel - dvrk/dvrk-ros: - type: git - url: https://github.com/jhu-dvrk/dvrk-ros.git - version: devel - dvrk/dvrk-gravity-compensation: - type: git - url: https://github.com/jhu-dvrk/dvrk-gravity-compensation.git - version: devel - dvrk/dvrk_config_jhu: - type: git - url: https://github.com/jhu-dvrk/dvrk_config_jhu.git - version: devel - dvrk/dESSJ-firmware: - type: git - url: https://github.com/jhu-dvrk/dESSJ-firmware.git - version: devel From 07e5f1502b5407f9b1fefed762e9221d41cd0b55 Mon Sep 17 00:00:00 2001 From: Anton Deguet Date: Fri, 29 Dec 2023 15:02:19 -0500 Subject: [PATCH 5/5] synch with ros 2 version --- dvrk_arms_from_ros/components/src/dvrk_arm_from_ros.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dvrk_arms_from_ros/components/src/dvrk_arm_from_ros.cpp b/dvrk_arms_from_ros/components/src/dvrk_arm_from_ros.cpp index 668e81f7..e46b8216 100644 --- a/dvrk_arms_from_ros/components/src/dvrk_arm_from_ros.cpp +++ b/dvrk_arms_from_ros/components/src/dvrk_arm_from_ros.cpp @@ -5,7 +5,7 @@ Author(s): Anton Deguet Created on: 2020-01-13 - (C) Copyright 2020-2022 Johns Hopkins University (JHU), All Rights Reserved. + (C) Copyright 2020-2023 Johns Hopkins University (JHU), All Rights Reserved. --- begin cisst license - do not edit --- @@ -48,12 +48,12 @@ void dvrk_arm_from_ros::Init(void) populate_interface_provided(interface_provided, ros_namespace, // void commands - Commands({"hold"}), + Commands({"hold", "free"}), // write commands - Commands({"state_command", "servo_cp"}), + Commands({"state_command", "servo_cp", "servo_js"}), // read commands Commands({"operating_state", "period_statistics", - "setpoint_js", "measured_js", "setpoint_cp"}), + "setpoint_js", "measured_js", "setpoint_cp", "measured_cp"}), // write events Commands({"operating_state", "error", "warning", "status"})); }