diff --git a/documentation/assembly/01_COMPUTER_CONFIGURATION.md b/documentation/assembly/01_COMPUTER_CONFIGURATION.md index 9ac52d8b..b8712e76 100644 --- a/documentation/assembly/01_COMPUTER_CONFIGURATION.md +++ b/documentation/assembly/01_COMPUTER_CONFIGURATION.md @@ -9,7 +9,8 @@ TODO ### A. OpenCR Dev Rule 1. Copy [100-opencr-custom.rules](../../firmwares/opencr_firmware/100-opencr-custom.rules) in `/etc/udev/rules.d/`. -2. Add the user to the `dialout` group. +2. Copy [100-teensy.rules](../../firmwares/psu_control/100-teensy.rules) in `/etc/udev/rules.d/`. +3. Add the user to the `dialout` group. ```bash sudo usermod -a -G dialout $USER diff --git a/firmwares/opencr_firmware/PsuControlCommandHandler.cpp b/firmwares/opencr_firmware/PsuControlCommandHandler.cpp index 5d28bf0b..912b8c09 100644 --- a/firmwares/opencr_firmware/PsuControlCommandHandler.cpp +++ b/firmwares/opencr_firmware/PsuControlCommandHandler.cpp @@ -43,13 +43,14 @@ void PsuControlCommandHandler::handleMessage() case MESSAGE_TYPE_STATUS: if (m_statusCommandHandler != nullptr) { - bool isBatteryCharging = m_buffer[2]; + bool isPsuConnected = m_buffer[2]; + bool isBatteryCharging = m_buffer[3]; float stateOfCharge, current, voltage; - memcpy(&stateOfCharge, m_buffer + 3, sizeof(float)); - memcpy(¤t, m_buffer + 7, sizeof(float)); - memcpy(&voltage, m_buffer + 11, sizeof(float)); - m_statusCommandHandler(isBatteryCharging, stateOfCharge, current, voltage); + memcpy(&stateOfCharge, m_buffer + 4, sizeof(float)); + memcpy(¤t, m_buffer + 8, sizeof(float)); + memcpy(&voltage, m_buffer + 12, sizeof(float)); + m_statusCommandHandler(isPsuConnected, isBatteryCharging, stateOfCharge, current, voltage); } break; } diff --git a/firmwares/opencr_firmware/PsuControlCommandHandler.h b/firmwares/opencr_firmware/PsuControlCommandHandler.h index 05028d8d..9f454674 100644 --- a/firmwares/opencr_firmware/PsuControlCommandHandler.h +++ b/firmwares/opencr_firmware/PsuControlCommandHandler.h @@ -3,7 +3,12 @@ #include -typedef void (*StatusCommandHandler)(bool isBatteryCharging, float stateOfCharge, float current, float voltage); +typedef void (*StatusCommandHandler)( + bool isPsuConnected, + bool isBatteryCharging, + float stateOfCharge, + float current, + float voltage); class PsuControlCommandHandler { diff --git a/firmwares/opencr_firmware/opencr_firmware.ino b/firmwares/opencr_firmware/opencr_firmware.ino index eeb46c70..973c0f35 100644 --- a/firmwares/opencr_firmware/opencr_firmware.ino +++ b/firmwares/opencr_firmware/opencr_firmware.ino @@ -50,14 +50,11 @@ float rawImuMsgData[RAW_IMU_MSG_DATA_LENGTH]; std_msgs::Float32MultiArray rawImuMsg; ros::Publisher rawImuPub("opencr/raw_imu", &rawImuMsg); -constexpr int STATE_OF_CHARGE_VOLTAGE_CURRENT_MSG_DATA_LENGTH = 3; -float stateOfChargeVoltageCurrentMsgData[STATE_OF_CHARGE_VOLTAGE_CURRENT_MSG_DATA_LENGTH]; -std_msgs::Float32MultiArray stateOfChargeVoltageCurrentMsg; -ros::Publisher - stateOfChargeVoltageCurrentPub("opencr/state_of_charge_voltage_current", &stateOfChargeVoltageCurrentMsg); - -std_msgs::Bool isBatteryChargingMsg; -ros::Publisher isBatteryChargingPub("opencr/is_battery_charging", &isBatteryChargingMsg); +// Message format : stateOfCharge, current, voltage, isPsuConnected, isBatteryCharging +constexpr int BASE_STATUS_MSG_DATA_LENGTH = 5; +float baseStatusMsgData[BASE_STATUS_MSG_DATA_LENGTH]; +std_msgs::Float32MultiArray baseStatusMsg; +ros::Publisher baseStatusPub("opencr/base_status", &baseStatusMsg); // Robot MPU9250 imu(SPI_IMU, BDPIN_SPI_CS_IMU); @@ -102,8 +99,7 @@ void setupRos() nh.advertise(currentHeadPosePub); nh.advertise(isHeadPoseReachablePub); nh.advertise(rawImuPub); - nh.advertise(stateOfChargeVoltageCurrentPub); - nh.advertise(isBatteryChargingPub); + nh.advertise(baseStatusPub); } void setupImu() @@ -204,13 +200,15 @@ void onImuTimer() rawImuPub.publish(&rawImuMsg); } -void onStatusCommand(bool isBatteryCharging, float stateOfCharge, float current, float voltage) +void onStatusCommand(bool isPsuConnected, bool isBatteryCharging, float stateOfCharge, float current, float voltage) { - stateOfChargeVoltageCurrentMsgData[0] = stateOfCharge; - stateOfChargeVoltageCurrentMsgData[1] = current; - stateOfChargeVoltageCurrentMsgData[2] = voltage; - - stateOfChargeVoltageCurrentMsg.data = &stateOfChargeVoltageCurrentMsgData[0]; - stateOfChargeVoltageCurrentMsg.data_length = STATE_OF_CHARGE_VOLTAGE_CURRENT_MSG_DATA_LENGTH; - stateOfChargeVoltageCurrentPub.publish(&stateOfChargeVoltageCurrentMsg); + baseStatusMsgData[0] = stateOfCharge; + baseStatusMsgData[1] = voltage; + baseStatusMsgData[2] = current; + baseStatusMsgData[3] = isPsuConnected; + baseStatusMsgData[4] = isBatteryCharging; + + baseStatusMsg.data = baseStatusMsgData; + baseStatusMsg.data_length = BASE_STATUS_MSG_DATA_LENGTH; + baseStatusPub.publish(&baseStatusMsg); } diff --git a/firmwares/psu_control/100-teensy.rules b/firmwares/psu_control/100-teensy.rules new file mode 100644 index 00000000..c4107865 --- /dev/null +++ b/firmwares/psu_control/100-teensy.rules @@ -0,0 +1,39 @@ +# UDEV Rules for Teensy boards, http://www.pjrc.com/teensy/ +# +# The latest version of this file may be found at: +# http://www.pjrc.com/teensy/00-teensy.rules +# +# This file must be placed at: +# +# /etc/udev/rules.d/00-teensy.rules (preferred location) +# or +# /lib/udev/rules.d/00-teensy.rules (req'd on some broken systems) +# +# To install, type this command in a terminal: +# sudo cp 00-teensy.rules /etc/udev/rules.d/00-teensy.rules +# +# After this file is installed, physically unplug and reconnect Teensy. +# +ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_PORT_IGNORE}="1" +ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789a]*", ENV{MTP_NO_PROBE}="1" +KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", GROUP:="dialout", RUN:="/bin/stty -F /dev/%k raw -echo" +KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", GROUP:="dialout" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04*", GROUP:="dialout" +KERNEL=="hidraw*", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013*", GROUP:="dialout" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", ATTRS{idProduct}=="013*", GROUP:="dialout" + +# +# If you share your linux system with other users, or just don't like the +# idea of write permission for everybody, you can replace MODE:="0666" with +# OWNER:="yourusername" to create the device owned by you, or with +# GROUP:="somegroupname" and mange access using standard unix groups. +# +# ModemManager tends to interfere with USB Serial devices like Teensy. +# Problems manifest as the Arduino Serial Monitor missing some incoming +# data, and "Unable to open /dev/ttyACM0 for reboot request" when +# uploading. If you experience these problems, disable or remove +# ModemManager from your system. If you must use a modem, perhaps +# try disabling the "MM_FILTER_RULE_TTY_ACM_INTERFACE" ModemManager +# rule. Changing ModemManager's filter policy from "strict" to "default" +# may also help. But if you don't use a modem, completely removing +# the troublesome ModemManager is the most effective solution. diff --git a/firmwares/psu_control/include/OpencrCommandSender.h b/firmwares/psu_control/include/OpencrCommandSender.h index f472cfb0..af8bdfdc 100644 --- a/firmwares/psu_control/include/OpencrCommandSender.h +++ b/firmwares/psu_control/include/OpencrCommandSender.h @@ -10,7 +10,12 @@ class OpencrCommandSender public: OpencrCommandSender(); - void sendStatusCommand(bool isBatteryCharging, float stateOfCharge, float current, float voltage); + void sendStatusCommand( + bool isPsuConnected, + bool isBatteryCharging, + float stateOfCharge, + float current, + float voltage); private: void sendCommand(); diff --git a/firmwares/psu_control/src/OpencrCommandSender.cpp b/firmwares/psu_control/src/OpencrCommandSender.cpp index 24b2b57a..43bce1fe 100644 --- a/firmwares/psu_control/src/OpencrCommandSender.cpp +++ b/firmwares/psu_control/src/OpencrCommandSender.cpp @@ -10,15 +10,21 @@ OpencrCommandSender::OpencrCommandSender() memset(m_buffer, 0, UINT8_MAX); } -void OpencrCommandSender::sendStatusCommand(bool isBatteryCharging, float stateOfCharge, float current, float voltage) +void OpencrCommandSender::sendStatusCommand( + bool isPsuConnected, + bool isBatteryCharging, + float stateOfCharge, + float current, + float voltage) { - m_buffer[0] = sizeof(float) * 3 + 3; + m_buffer[0] = sizeof(float) * 3 + 4; m_buffer[1] = MESSAGE_TYPE_STATUS; - m_buffer[2] = static_cast(isBatteryCharging); + m_buffer[2] = static_cast(isPsuConnected); + m_buffer[3] = static_cast(isBatteryCharging); - memcpy(m_buffer + 3, &stateOfCharge, sizeof(float)); - memcpy(m_buffer + 7, ¤t, sizeof(float)); - memcpy(m_buffer + 11, &voltage, sizeof(float)); + memcpy(m_buffer + 4, &stateOfCharge, sizeof(float)); + memcpy(m_buffer + 8, ¤t, sizeof(float)); + memcpy(m_buffer + 12, &voltage, sizeof(float)); sendCommand(); } diff --git a/firmwares/psu_control/src/mainNormal.cpp b/firmwares/psu_control/src/mainNormal.cpp index 9932d451..18f461aa 100644 --- a/firmwares/psu_control/src/mainNormal.cpp +++ b/firmwares/psu_control/src/mainNormal.cpp @@ -98,7 +98,10 @@ void onStatusTicker() float current = currentVoltageSensor.readCurrent(); float voltage = currentVoltageSensor.readVoltage(); + bool isPsuConnected = charger.isPsuConnected(); + DEBUG_SERIAL.print("isPsuConnected="); + DEBUG_SERIAL.println(isPsuConnected); DEBUG_SERIAL.print("isBatteryCharging="); DEBUG_SERIAL.println(isBatteryCharging); DEBUG_SERIAL.print("stateOfCharge="); @@ -113,7 +116,7 @@ void onStatusTicker() DEBUG_SERIAL.println(externalTemperatureCelsius); DEBUG_SERIAL.println("Send status"); DEBUG_SERIAL.println(); - opencrCommandSender.sendStatusCommand(isBatteryCharging, stateOfCharge, current, voltage); + opencrCommandSender.sendStatusCommand(isPsuConnected, isBatteryCharging, stateOfCharge, current, voltage); } #endif diff --git a/ros/behaviors/teleoperation/CMakeLists.txt b/ros/behaviors/teleoperation/CMakeLists.txt index d749475c..60b4bfdf 100644 --- a/ros/behaviors/teleoperation/CMakeLists.txt +++ b/ros/behaviors/teleoperation/CMakeLists.txt @@ -8,13 +8,13 @@ project(teleoperation) ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages find_package(catkin REQUIRED COMPONENTS - hbba_lite - rospy - std_msgs - t_top - geometry_msgs - message_generation - ) + hbba_lite + rospy + std_msgs + t_top + geometry_msgs + opentera_webrtc_ros_msgs +) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) @@ -57,10 +57,10 @@ find_package(catkin REQUIRED COMPONENTS # ) ## Generate services in the 'srv' folder -add_service_files( - FILES - DoAction.srv -) +# add_service_files( +# FILES +# DoAction.srv +# ) ## Generate actions in the 'action' folder # add_action_files( @@ -70,7 +70,7 @@ add_service_files( # ) ## Generate added messages and services with any dependencies listed here -generate_messages() +# generate_messages() ################################################ ## Declare ROS dynamic reconfigure parameters ## @@ -104,7 +104,7 @@ generate_messages() catkin_package( # INCLUDE_DIRS include # LIBRARIES gesture - # CATKIN_DEPENDS hbba_lite rospy std_msgs t_top + CATKIN_DEPENDS hbba_lite rospy std_msgs t_top opentera_webrtc_ros_msgs # DEPENDS system_lib ) diff --git a/ros/behaviors/teleoperation/package.xml b/ros/behaviors/teleoperation/package.xml index c3250069..b2e8f7e7 100644 --- a/ros/behaviors/teleoperation/package.xml +++ b/ros/behaviors/teleoperation/package.xml @@ -54,18 +54,18 @@ std_msgs t_top geometry_msgs - message_generation + opentera_webrtc_ros_msgs hbba_lite rospy std_msgs t_top geometry_msgs - message_generation + opentera_webrtc_ros_msgs hbba_lite rospy std_msgs t_top - geometry_msgs + opentera_webrtc_ros_msgs diff --git a/ros/behaviors/teleoperation/scripts/teleoperation_node.py b/ros/behaviors/teleoperation/scripts/teleoperation_node.py index 22cce6a7..87cf2346 100755 --- a/ros/behaviors/teleoperation/scripts/teleoperation_node.py +++ b/ros/behaviors/teleoperation/scripts/teleoperation_node.py @@ -5,7 +5,7 @@ from contextlib import contextmanager from t_top import MovementCommands, HEAD_ZERO_Z -from teleoperation.srv import DoAction, DoActionRequest, DoActionResponse +from opentera_webrtc_ros_msgs.srv import SetString, SetStringRequest, SetStringResponse def twist_is_null(twist: Twist) -> bool: @@ -46,7 +46,7 @@ def __init__(self): self._movement_commands.sleep_time), self._on_timer_cb) self._origin_serv = rospy.Service( - "teleop_do_action", DoAction, self._do_action_cb) + "teleop_do_action", SetString, self._do_action_cb) def _on_twist_cb(self, msg): if self._movement_commands.is_filtering_all_messages: @@ -90,7 +90,7 @@ def _move(self, msg: Twist) -> None: self._state.current_speed = TeleopAngles( torso_angle=msg.angular.z/0.15, head_angle=-1.1*msg.linear.x/0.15) - def _do_action_cb(self, req: DoActionRequest) -> DoActionResponse: + def _do_action_cb(self, req: SetStringRequest) -> SetStringResponse: jump_table = { "goto_origin": self._goto_origin, "do_yes": self._do_yes, @@ -100,15 +100,15 @@ def _do_action_cb(self, req: DoActionRequest) -> DoActionResponse: "goto_origin_torso": self._goto_origin_torso, } - if req.name in jump_table: + if req.data in jump_table: if self._movement_commands.is_filtering_all_messages: - return DoActionResponse(success=False, message="HBBA filter is active") + return SetStringResponse(success=False, message="HBBA filter is active") - jump_table[req.name]() - return DoActionResponse(success=True, message="") + jump_table[req.data]() + return SetStringResponse(success=True, message="") else: - return DoActionResponse(success=False, message=f"'{req.name}' not in {list(jump_table.keys())}") + return SetStringResponse(success=False, message=f"'{req.data}' not in {list(jump_table.keys())}") @contextmanager def _pause_moving(self): diff --git a/ros/behaviors/teleoperation/srv/DoAction.srv b/ros/behaviors/teleoperation/srv/DoAction.srv deleted file mode 100644 index 9fa6a16f..00000000 --- a/ros/behaviors/teleoperation/srv/DoAction.srv +++ /dev/null @@ -1,4 +0,0 @@ -string name ---- -bool success -string message diff --git a/ros/demos/README.md b/ros/demos/README.md index 8f9247b5..d09b3bba 100644 --- a/ros/demos/README.md +++ b/ros/demos/README.md @@ -7,3 +7,4 @@ This folder contains ROS packages performing robot demonstrations. - The [control_panel](control_panel) folder contains a graphical user interface to control T-Top's features manually. - The [smart_speaker](smart_speaker) folder contains a node that makes T-Top a smart speaker that can tell the current weather, the weather forecast or a story. Also, it can dance to the ambiant music or play a song and dance. +- The [ttop_opentera](ttop_opentera) folder contains a node that makes T-Top a telepresence robot using OpenTera. diff --git a/ros/demos/control_panel/launch/control_panel.launch b/ros/demos/control_panel/launch/control_panel.launch index fff8eb85..30ba305c 100644 --- a/ros/demos/control_panel/launch/control_panel.launch +++ b/ros/demos/control_panel/launch/control_panel.launch @@ -1,10 +1,13 @@ - + + + + diff --git a/ros/demos/control_panel/src/widgets/ControlPanel.cpp b/ros/demos/control_panel/src/widgets/ControlPanel.cpp index 85e096e1..b17abadf 100644 --- a/ros/demos/control_panel/src/widgets/ControlPanel.cpp +++ b/ros/demos/control_panel/src/widgets/ControlPanel.cpp @@ -23,7 +23,7 @@ ControlPanel::ControlPanel(ros::NodeHandle& nodeHandle, shared_ptr de createUi(); m_batterySubscriber = nodeHandle.subscribe( - "opencr/state_of_charge_voltage_current", + "opencr/base_status", 1, &ControlPanel::batterySubscriberCallback, this); @@ -38,7 +38,7 @@ void ControlPanel::onVolumeChanged(int volume) void ControlPanel::batterySubscriberCallback(const std_msgs::Float32MultiArray::ConstPtr& msg) { - if (msg->data.size() == 3) + if (msg->data.size() == 4) { int battery = static_cast(msg->data[0]); invokeLater([this, battery]() { m_batteryLevel->display(QString::number(battery)); }); diff --git a/ros/demos/smart_speaker/launch/smart_speaker_rss.launch b/ros/demos/smart_speaker/launch/smart_speaker_rss.launch index f8b12419..2b00354a 100644 --- a/ros/demos/smart_speaker/launch/smart_speaker_rss.launch +++ b/ros/demos/smart_speaker/launch/smart_speaker_rss.launch @@ -1,7 +1,9 @@ - + + + @@ -12,5 +14,6 @@ + diff --git a/ros/demos/smart_speaker/launch/smart_speaker_smart.launch b/ros/demos/smart_speaker/launch/smart_speaker_smart.launch index 52ffc03e..15415111 100644 --- a/ros/demos/smart_speaker/launch/smart_speaker_smart.launch +++ b/ros/demos/smart_speaker/launch/smart_speaker_smart.launch @@ -1,7 +1,9 @@ - + + + @@ -20,5 +22,6 @@ + diff --git a/ros/demos/ttop_opentera/README.md b/ros/demos/ttop_opentera/README.md index c7183abc..02ff2d43 100644 --- a/ros/demos/ttop_opentera/README.md +++ b/ros/demos/ttop_opentera/README.md @@ -2,8 +2,41 @@ This folder contains a node that makes T-Top a telepresence robot using OpenTera. + +## Installation +1. Follow the installation guide for [T-Top](../../../documentation/assembly/01_COMPUTER_CONFIGURATION.md) dependencies. +2. Install the requirements for OpenTera from the [system](../../opentera-webrtc-ros/README.md#Requirements) and for [Python](../../opentera-webrtc-ros/README.md#3---Install-the-Python-requirements). +3. Build the ROS workspace using `catkin_make`. + ## How to Launch +The OpenTera telepresence stack can be launched in stand-alone mode or using the OpenTera servers. + +### Stand-alone mode +To launch in stand-alone mode, you will need to generate CA certificates and keys. Follow the guide [here](../../../tools/ca_certificates/ca_certificate_setup.md). +1. Start the ROS stack. ```bash +export DISPLAY=:0.0 roslaunch ttop_opentera ttop_opentera.launch ``` +2. On your developpement machine, navigate to `https://:8080/index.html#/user?pwd=abc&robot=TTOP`, where `` is the IP address of your robot on the LAN. + + +### OpenTera Server +To launch using the OpenTera servers, you will need to configure the OpenTera servers: +1. Generate a unique token for the robot using `OpenTeraPlus`. +2. Copy the template config file to the destination: +```bash +mkdir -p ~/.ros/opentera +cp $(rospack find opentera_client_ros)/config/client_config.json ~/.ros/opentera/client_config.json +``` +3. Edit the file `~/.ros/opentera/client_config.json` to set the token and url to the token from step 1 and `https://telesante.3it.usherbrooke.ca:40075`, respectively. + +1. Start the ROS stack. +```bash +export DISPLAY=:0.0 +roslaunch ttop_opentera ttop_opentera_online.launch +``` + +2. On your developpement machine, navigate to `https://telesante.3it.usherbrooke.ca:40075/robot/#/login`. +Login using your account, and select the robot you want to control. diff --git a/ros/demos/ttop_opentera/launch/ttop_opentera.launch b/ros/demos/ttop_opentera/launch/ttop_opentera.launch index efd3ee04..edb7cd78 100644 --- a/ros/demos/ttop_opentera/launch/ttop_opentera.launch +++ b/ros/demos/ttop_opentera/launch/ttop_opentera.launch @@ -1,7 +1,11 @@ + + + - + + - + diff --git a/ros/demos/ttop_opentera/launch/ttop_opentera_online.launch b/ros/demos/ttop_opentera/launch/ttop_opentera_online.launch new file mode 100644 index 00000000..4b419ea2 --- /dev/null +++ b/ros/demos/ttop_opentera/launch/ttop_opentera_online.launch @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/ros/hbba_lite b/ros/hbba_lite index 87c95cbe..15902316 160000 --- a/ros/hbba_lite +++ b/ros/hbba_lite @@ -1 +1 @@ -Subproject commit 87c95cbe33ebeeaacab9cfc03529a0645dfbaf77 +Subproject commit 15902316a3064dbfe9f7b07dae5abc80b3bf832c diff --git a/ros/opentera-webrtc-ros b/ros/opentera-webrtc-ros index 12c3ea9f..0caebd3a 160000 --- a/ros/opentera-webrtc-ros +++ b/ros/opentera-webrtc-ros @@ -1 +1 @@ -Subproject commit 12c3ea9fc4b0c1e1de7190f192600da408b673bd +Subproject commit 0caebd3addad22771bf3d44364f4618ecf9003ee diff --git a/ros/perceptions/odas_ros b/ros/perceptions/odas_ros index 237ae2a4..ad01e0a9 160000 --- a/ros/perceptions/odas_ros +++ b/ros/perceptions/odas_ros @@ -1 +1 @@ -Subproject commit 237ae2a4c9718384a8e8cde3f14cfdfb0a2e81a8 +Subproject commit ad01e0a9b808ab360a75fd8f4e207bb2a1c3205e diff --git a/ros/perceptions/person_identification/launch/capture_face.launch b/ros/perceptions/person_identification/launch/capture_face.launch index ab59d93e..acff7337 100644 --- a/ros/perceptions/person_identification/launch/capture_face.launch +++ b/ros/perceptions/person_identification/launch/capture_face.launch @@ -2,6 +2,8 @@ + + @@ -31,7 +33,7 @@ - + diff --git a/ros/perceptions/person_identification/launch/capture_voice.launch b/ros/perceptions/person_identification/launch/capture_voice.launch index ecc194fa..3fbbe1e2 100644 --- a/ros/perceptions/person_identification/launch/capture_voice.launch +++ b/ros/perceptions/person_identification/launch/capture_voice.launch @@ -2,6 +2,8 @@ + + @@ -35,7 +37,7 @@ - + diff --git a/ros/t_top/CMakeLists.txt b/ros/t_top/CMakeLists.txt index 865336e8..dbec7fc9 100644 --- a/ros/t_top/CMakeLists.txt +++ b/ros/t_top/CMakeLists.txt @@ -8,8 +8,8 @@ project(t_top) ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages find_package(catkin REQUIRED COMPONENTS - rospy - ) + rospy +) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) @@ -158,9 +158,10 @@ include_directories( ## Mark executable scripts (Python etc.) for installation ## in contrast to setup.py, you can choose the destination catkin_install_python(PROGRAMS - scripts/opencr_raw_data_interpreter.py - DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} - ) + scripts/opencr_raw_data_interpreter.py + scripts/robot_status.py + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) ## Mark executables for installation ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html diff --git a/ros/t_top/launch/behaviors/opentera.launch b/ros/t_top/launch/behaviors/opentera.launch index 3e7c3c2b..18ae6482 100644 --- a/ros/t_top/launch/behaviors/opentera.launch +++ b/ros/t_top/launch/behaviors/opentera.launch @@ -2,35 +2,33 @@ - + - - + + + + - + - - + + + - - - - - - - - - - + + + + - + + @@ -44,17 +42,18 @@ - + - - + + + - + @@ -62,24 +61,26 @@ - + - + + - + + @@ -112,19 +113,11 @@ - + - + - - - - - - - - diff --git a/ros/t_top/launch/behaviors/teleoperation.launch b/ros/t_top/launch/behaviors/teleoperation.launch index 81c64a12..08b976e4 100644 --- a/ros/t_top/launch/behaviors/teleoperation.launch +++ b/ros/t_top/launch/behaviors/teleoperation.launch @@ -5,6 +5,7 @@ + diff --git a/ros/t_top/launch/bringup.launch b/ros/t_top/launch/bringup.launch index d539aa12..dcef991b 100644 --- a/ros/t_top/launch/bringup.launch +++ b/ros/t_top/launch/bringup.launch @@ -4,6 +4,7 @@ + @@ -12,6 +13,7 @@ + diff --git a/ros/t_top/launch/opentera_teleop.launch b/ros/t_top/launch/opentera_teleop.launch index 914f1e41..a3449bf0 100644 --- a/ros/t_top/launch/opentera_teleop.launch +++ b/ros/t_top/launch/opentera_teleop.launch @@ -1,17 +1,19 @@ - + + + - + @@ -25,10 +27,9 @@ + - - @@ -41,7 +42,8 @@ - + + diff --git a/ros/t_top/launch/perceptions.launch b/ros/t_top/launch/perceptions.launch index 5e8e4fd4..e21b0e38 100644 --- a/ros/t_top/launch/perceptions.launch +++ b/ros/t_top/launch/perceptions.launch @@ -4,6 +4,7 @@ + @@ -17,6 +18,7 @@ + diff --git a/ros/t_top/launch/perceptions/odas.launch b/ros/t_top/launch/perceptions/odas.launch index cd4c5cf7..887e37ea 100644 --- a/ros/t_top/launch/perceptions/odas.launch +++ b/ros/t_top/launch/perceptions/odas.launch @@ -5,16 +5,17 @@ + - + - + @@ -22,7 +23,7 @@ - + diff --git a/ros/t_top/launch/perceptions/rtabmap.launch b/ros/t_top/launch/perceptions/rtabmap.launch index d62ca5b4..c379f8c7 100644 --- a/ros/t_top/launch/perceptions/rtabmap.launch +++ b/ros/t_top/launch/perceptions/rtabmap.launch @@ -1,4 +1,7 @@ + + + @@ -12,19 +15,36 @@ - - + + - - + + + + + + + - + + + + + + + + + + + + + diff --git a/ros/t_top/launch/platform/sensors.launch b/ros/t_top/launch/platform/sensors.launch index 39283a6f..70f5848d 100644 --- a/ros/t_top/launch/platform/sensors.launch +++ b/ros/t_top/launch/platform/sensors.launch @@ -4,9 +4,9 @@ - - - + + + diff --git a/ros/t_top/launch/rviz.launch b/ros/t_top/launch/rviz.launch index a286bf31..3391667c 100644 --- a/ros/t_top/launch/rviz.launch +++ b/ros/t_top/launch/rviz.launch @@ -1,7 +1,7 @@ - + diff --git a/ros/t_top/meshes/d435.dae b/ros/t_top/meshes/d435.dae new file mode 100644 index 00000000..41f3a87c --- /dev/null +++ b/ros/t_top/meshes/d435.dae @@ -0,0 +1,1658 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + realsense-ros/d435.dae at development · IntelRealSense/realsense-ros + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + +
+ +
+ + + + + +
+ + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + + +
+ +
+ +
+

+ + + / + + realsense-ros + + +

+ + +
+ +
    + +
  • + +
    + + + + + + + + Watch + + + + + +
    +
    +

    Notifications

    + +
    + +
    +
    + + + + + + + + +
    + +
    +
    +
    + + +
    +
    + +
    + + + +
  • + +
  • +
    +
    + + +
    +
    + + +
    + +
  • + +
  • +
    +
    + + + Fork + + + +
    + +

    Fork realsense-ros

    +
    + +
    + +
    +

    If this dialog fails to load, you can visit the fork page directly.

    +
    +
    + +
    +
    +
    + + +
  • +
+ +
+ + + + +
+ + +
+
+ + + + +
+ + + + Permalink + + + +
+ +
+
+ + + development + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + + Go to file + + +
+ + + + + + + + + +
+
+
+ + + +
+ +
+
+ + + +
+ + + + + + +
+
+ + Latest commit + 52543ac + Mar 20, 2019 + + + + + + History + + +
+
+ +
+ +
+
+ + + 0 + + contributors + + +
+ +

+ Users who have contributed to this file +

+
+ + + + + + +
+
+
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + 15.1 MB +
+ +
+ + + +
+ + + + +
+ +
+
+ +
+ +
+
+ + + +
+
+ View raw +

(Sorry about that, but we can’t show files that are this big right now.)

+
+
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + diff --git a/ros/t_top/meshes/rotating_base_mesh.dae b/ros/t_top/meshes/rotating_base_mesh.dae new file mode 100644 index 00000000..192230c7 --- /dev/null +++ b/ros/t_top/meshes/rotating_base_mesh.dae @@ -0,0 +1,107 @@ + + + + + Blender User + Blender 2.92.0 commit date:2021-02-24, commit time:16:25, hash:02948a2cab44 + + 2021-05-28T09:28:17 + 2021-05-28T09:28:17 + + Z_UP + + + + + + 1000 1000 1000 + 1 + 0 + 0.00111109 + + + + + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 1000 + 29.99998 + 75 + 0.15 + 0 + 1 + 2 + 0.04999995 + 30.002 + 1 + 3 + 2880 + 3 + 1 + 1 + 0.1 + 0.1 + 1 + + + + + + + + + + 0.1840202 0.02449995 0.02403783 0.168258 0.02449995 0.01373994 0.1737391 0.02449995 0.07950961 0.009601831 0.02449995 0.06820672 0.003488302 0.02449995 0.08601462 0.02108168 0.02449995 0.07950961 0.1655865 0.02449995 0.03138881 0.1361417 0.02449995 0.04838883 0.1408208 0.02449995 0.07950961 0.209437 0.02449995 0.1763521 0.2183982 0.02449995 0.1597933 0.18825 0.02449995 0.1659808 0.1978725 0.02449995 0.1912101 0.18825 0.02449995 0.1999807 0.1840202 0.02449995 0.203962 0.1737391 0.02449995 0.1999807 0.168258 0.02449995 0.21426 0.1510156 0.02449995 0.2218232 0.15975 0.02449995 0.1999807 0.1327638 0.02449995 0.2264451 0.1737391 0.02449995 0.1659808 0.1737391 0.02449995 0.1591464 0.15975 0.02449995 0.1659808 0.1408208 0.02449995 0.1591464 0.05426079 0.02449995 0.1591464 0.05426079 0.02449995 0.1659808 0.06825 0.02449995 0.1659808 0.114 0.02449995 0.1591464 0.06825 0.02449995 0.1999807 0.09523618 0.02449995 0.2264451 0.03974992 0.02449995 0.1999807 0.0439797 0.02449995 0.203962 0.05426079 0.02449995 0.1999807 0.05974197 0.02449995 0.21426 0.07698422 0.02449995 0.2218232 0.03974992 0.02449995 0.1659808 0.02108168 0.02449995 0.1591464 0.114 0.02449995 0.07950961 0.1513365 0.02449995 0.006707191 0.1510156 0.02449995 0.006176829 0.1218916 0.02449995 0.02370721 0.1327638 0.02449995 0.001554787 0.114 0.02449995 0.003353536 0.114 0.02449995 0 0.09523618 0.02449995 0.001554787 0.05426079 0.02449995 0.07950961 0.01666343 0.02449995 0.1106303 0.0461083 0.02449995 0.1276302 0.03185832 0.02449995 0.152312 0.003488302 0.02449995 0.1419852 0.009601831 0.02449995 0.1597933 0.01856297 0.02449995 0.1763521 0.03012746 0.02449995 0.1912101 0.002413392 0.02449995 0.135312 3.89367e-4 0.02449995 0.104586 3.89367e-4 0.02449995 0.123414 0.06241345 0.02449995 0.03138881 0.09185832 0.02449995 0.04838883 0.1061083 0.02449995 0.02370721 0.07666343 0.02449995 0.006707191 0.05974197 0.02449995 0.01373994 0.0439797 0.02449995 0.02403783 0.03012746 0.02449995 0.03678989 0.01856297 0.02449995 0.0516479 0.07698422 0.02449995 0.006176829 0.2183982 0.02449995 0.06820672 0.209437 0.02449995 0.0516479 0.1978725 0.02449995 0.03678989 0.1818916 0.02449995 0.1276302 0.2113365 0.02449995 0.1106303 0.2245116 0.02449995 0.08601462 0.1961417 0.02449995 0.152312 0.2245116 0.02449995 0.1419852 0.2255865 0.02449995 0.135312 0.2276106 0.02449995 0.123414 0.2276106 0.02449995 0.104586 0.114 0.02449995 0.228 0.114 0 0 0.1327638 0 0.001554787 0.1510156 0 0.006176829 0.168258 0 0.01373994 0.1840202 0 0.02403783 0.1978725 0 0.03678989 0.209437 0 0.0516479 0.2183982 0 0.06820672 0.2245116 0 0.08601462 0.2276106 0 0.104586 0.2276106 0 0.123414 0.2245116 0 0.1419852 0.2183982 0 0.1597933 0.209437 0 0.1763521 0.1978725 0 0.1912101 0.1840202 0 0.203962 0.168258 0 0.21426 0.1510156 0 0.2218232 0.1327638 0 0.2264451 0.114 0 0.228 0.09523618 0 0.2264451 0.07698422 0 0.2218232 0.05974197 0 0.21426 0.0439797 0 0.203962 0.03012746 0 0.1912101 0.01856297 0 0.1763521 0.009601831 0 0.1597933 0.003488302 0 0.1419852 3.89367e-4 0 0.123414 3.89367e-4 0 0.104586 0.003488302 0 0.08601462 0.009601831 0 0.06820672 0.01856297 0 0.0516479 0.03012746 0 0.03678989 0.0439797 0 0.02403783 0.05974197 0 0.01373994 0.07698422 0 0.006176829 0.09523618 0 0.001554787 0.114 0 0.114 0.07666343 0.07099997 0.006707191 0.1061083 0.07099997 0.02370721 0.06241345 0.07099997 0.03138881 0.09185832 0.07099997 0.04838883 0.03185832 0.07099997 0.152312 0.002413392 0.07099997 0.135312 0.0461083 0.07099997 0.1276302 0.01666343 0.07099997 0.1106303 0.1218916 0.07099997 0.02370721 0.1513365 0.07099997 0.006707191 0.1361417 0.07099997 0.04838883 0.1655865 0.07099997 0.03138881 0.1818916 0.07099997 0.1276302 0.2113365 0.07099997 0.1106303 0.1961417 0.07099997 0.152312 0.2255865 0.07099997 0.135312 0.03974992 0.07099997 0.1999807 0.03974992 0.07099997 0.1659808 0.06825 0.07099997 0.1999807 0.06825 0.07099997 0.1659808 0.15975 0.07099997 0.1999807 0.15975 0.07099997 0.1659808 0.18825 0.07099997 0.1999807 0.18825 0.07099997 0.1659808 + + + + + + + + + + 0 1 0 0 1 0 0 1 0 0 1 -2.62332e-7 0 1 0 0 1 -1.20042e-5 0 1 1.00754e-6 0 1 -1.72591e-7 0 1 1.90497e-7 0 1 0 0 1 3.45181e-7 0 1 1.87431e-7 0 1 0 0 1 0 0 1 5.52462e-6 0 1 -1.28049e-7 0 1 -1.46949e-7 0 1 -2.67768e-7 0 1 -2.74532e-7 0 1 1.40114e-6 0 1 5.13386e-7 0 1 -5.13386e-7 0 1 -1.25237e-7 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1.24522e-7 0 1 7.10076e-6 0 1 -8.66386e-6 0 1 0 0 1 0 0 1 0 0 1 1.51147e-7 0 1 -3.9352e-7 0 1 3.64127e-7 0 1 -1.31667e-7 0 1 1.42892e-7 0 1 -1.36015e-7 0 1 0 0 1 0 0.082578 0 -0.9965847 0.2454885 0 -0.9693995 0.4016907 0 -0.9157755 0.4016906 0 -0.9157755 0.5469476 0 -0.837167 0.6772834 0 -0.7357224 0.6772835 0 -0.7357223 0.7891396 0 -0.614214 0.7891395 0 -0.6142141 0.8794734 0 -0.4759481 0.9458181 0 -0.324697 0.9863616 0 -0.1645936 1 0 0 0.9863613 0 0.1645949 0.9863613 0 0.1645951 0.945819 0 0.3246944 0.9458192 0 0.3246938 0.8794732 0 0.4759485 0.7891395 0 0.6142141 0.6772812 0 0.7357244 0.67728 0 0.7357254 0.5469486 0 0.8371662 0.5469501 0 0.8371652 0.4016942 0 0.9157739 0.2454823 0 0.9694012 0.0825836 0 0.9965842 0.08258563 0 0.9965841 -0.08258551 0 0.9965841 -0.08258348 0 0.9965842 -0.2454801 0 0.9694017 -0.4016972 0 0.9157726 -0.5469486 0 0.8371663 -0.5469473 0 0.8371672 -0.6772816 0 0.735724 -0.6772827 0 0.7357229 -0.7891396 0 0.614214 -0.8794745 0 0.475946 -0.9458173 0 0.3246994 -0.9458171 0 0.3247 -0.9863618 0 0.164592 -0.9863618 0 0.1645918 -1 0 0 -0.986362 0 -0.1645905 -0.9458162 0 -0.3247027 -0.8794748 0 -0.4759457 -0.7891396 0 -0.614214 -0.7891396 0 -0.6142138 -0.677285 0 -0.7357208 -0.6772848 0 -0.7357209 -0.5469462 0 -0.8371679 -0.4016937 0 -0.9157742 -0.4016937 0 -0.9157742 -0.2454863 0 -0.9694002 -0.08257782 0 -0.9965847 0 -1 0 0.5000004 0 -0.8660253 -0.8660254 0 -0.5000001 -0.8660255 0 -0.5 -0.5000004 0 0.8660252 -0.5000004 0 0.8660253 0.8660254 0 0.5000002 0.8660254 0 0.5000001 -0.4999986 0 0.8660263 -0.4999991 0 0.8660261 0.8660264 0 0.4999984 0.8660263 0 0.4999987 0.499998 0 -0.8660266 0.4999976 0 -0.8660268 -0.8660248 0 -0.5000011 -0.8660246 0 -0.5000014 0 1 -2.40279e-7 -0.4999999 0 -0.8660256 -0.5 0 -0.8660255 -0.8660236 0 0.5000033 -0.8660236 0 0.5000032 0.5000013 0 0.8660248 0.5000014 0 0.8660247 0.8660251 0 -0.5000005 0.8660252 0 -0.5000005 -0.4999971 0 -0.8660271 -0.4999976 0 -0.8660268 -0.8660244 0 0.5000019 -0.8660247 0 0.5000015 0.5000007 0 0.866025 0.5000003 0 0.8660253 0.8660253 0 -0.5000003 0.8660255 0 -0.4999999 0 0 1 0 0 -1 + + + + + + + + + + + + + + +

0 0 1 0 2 0 3 1 4 1 5 1 6 2 7 2 8 2 9 3 10 3 11 3 9 4 11 4 12 4 12 1 11 1 13 1 12 5 13 5 14 5 14 6 13 6 15 6 14 7 15 7 16 7 16 1 15 1 17 1 17 8 15 8 18 8 17 1 18 1 19 1 20 1 21 1 22 1 22 1 21 1 23 1 24 1 25 1 26 1 24 1 26 1 27 1 27 1 26 1 28 1 27 9 28 9 29 9 30 1 31 1 32 1 32 10 31 10 33 10 32 1 33 1 28 1 28 11 33 11 34 11 28 1 34 1 29 1 30 1 35 1 36 1 8 1 7 1 37 1 8 12 2 12 6 12 6 13 2 13 1 13 6 1 1 1 38 1 38 1 1 1 39 1 38 14 39 14 40 14 40 15 39 15 41 15 40 16 41 16 42 16 42 1 41 1 43 1 42 1 43 1 44 1 45 17 5 17 46 17 47 1 48 1 24 1 49 1 50 1 36 1 36 1 50 1 51 1 36 18 51 18 30 18 30 19 51 19 52 19 30 1 52 1 31 1 46 1 5 1 53 1 53 1 5 1 4 1 53 1 4 1 54 1 54 1 55 1 53 1 53 1 55 1 49 1 53 1 49 1 48 1 48 1 49 1 36 1 48 20 36 20 24 20 24 21 36 21 35 21 24 1 35 1 25 1 56 1 45 1 57 1 57 22 45 22 37 22 57 23 37 23 58 23 59 24 60 24 56 24 56 1 60 1 61 1 56 1 61 1 45 1 45 1 61 1 62 1 45 25 62 25 5 25 5 1 62 1 63 1 5 1 63 1 3 1 7 26 40 26 37 26 37 1 40 1 42 1 37 1 42 1 58 1 58 1 42 1 44 1 58 27 44 27 59 27 59 28 44 28 64 28 59 29 64 29 60 29 65 1 66 1 2 1 2 30 66 30 67 30 2 31 67 31 0 31 2 32 68 32 65 32 65 1 68 1 69 1 65 33 69 33 70 33 20 1 11 1 21 1 21 34 11 34 10 34 21 35 10 35 71 35 71 36 10 36 72 36 71 37 72 37 73 37 73 1 72 1 74 1 73 1 74 1 69 1 69 1 74 1 75 1 69 38 75 38 70 38 29 1 76 1 27 1 27 1 76 1 19 1 27 39 19 39 23 39 23 1 19 1 18 1 23 1 18 1 22 1 71 1 68 1 21 1 21 1 68 1 2 1 21 1 2 1 23 1 23 1 2 1 8 1 23 1 8 1 27 1 27 1 8 1 37 1 27 1 37 1 24 1 24 1 37 1 45 1 24 1 45 1 47 1 47 40 45 40 46 40 77 41 41 41 78 41 78 42 41 42 39 42 78 42 39 42 79 42 79 43 39 43 1 43 79 44 1 44 80 44 80 45 1 45 0 45 80 45 0 45 81 45 81 46 0 46 67 46 81 47 67 47 82 47 82 48 67 48 66 48 82 49 66 49 83 49 83 50 66 50 65 50 83 50 65 50 84 50 84 51 65 51 70 51 84 51 70 51 85 51 85 52 70 52 75 52 85 52 75 52 86 52 86 53 75 53 74 53 86 53 74 53 87 53 87 54 74 54 72 54 87 55 72 55 88 55 88 56 72 56 10 56 88 57 10 57 89 57 89 58 10 58 9 58 89 58 9 58 90 58 90 59 9 59 12 59 90 59 12 59 91 59 91 60 12 60 14 60 91 61 14 61 92 61 92 62 14 62 16 62 92 63 16 63 93 63 93 64 16 64 17 64 93 64 17 64 94 64 94 65 17 65 19 65 94 65 19 65 95 65 95 66 19 66 76 66 95 67 76 67 96 67 96 68 76 68 29 68 96 69 29 69 97 69 97 70 29 70 34 70 97 70 34 70 98 70 98 71 34 71 33 71 98 71 33 71 99 71 99 72 33 72 31 72 99 73 31 73 100 73 100 74 31 74 52 74 100 75 52 75 101 75 101 76 52 76 51 76 101 76 51 76 102 76 102 77 51 77 50 77 102 77 50 77 103 77 103 78 50 78 49 78 103 79 49 79 104 79 104 80 49 80 55 80 104 81 55 81 105 81 105 82 55 82 54 82 105 82 54 82 106 82 106 83 54 83 4 83 106 83 4 83 107 83 107 84 4 84 3 84 107 84 3 84 108 84 108 85 3 85 63 85 108 85 63 85 109 85 109 86 63 86 62 86 109 87 62 87 110 87 110 88 62 88 61 88 110 89 61 89 111 89 111 90 61 90 60 90 111 90 60 90 112 90 112 91 60 91 64 91 112 92 64 92 113 92 113 93 64 93 44 93 113 93 44 93 114 93 114 94 44 94 43 94 114 94 43 94 77 94 77 41 43 41 41 41 96 95 97 95 115 95 96 95 115 95 95 95 92 95 93 95 115 95 115 95 93 95 94 95 115 95 94 95 95 95 89 95 90 95 115 95 115 95 90 95 91 95 115 95 91 95 92 95 86 95 87 95 115 95 115 95 87 95 88 95 115 95 88 95 89 95 83 95 84 95 115 95 115 95 84 95 85 95 115 95 85 95 86 95 80 95 81 95 115 95 115 95 81 95 82 95 115 95 82 95 83 95 77 95 78 95 115 95 115 95 78 95 79 95 115 95 79 95 80 95 112 95 113 95 115 95 115 95 113 95 114 95 115 95 114 95 77 95 109 95 110 95 115 95 115 95 110 95 111 95 115 95 111 95 112 95 106 95 107 95 115 95 115 95 107 95 108 95 115 95 108 95 109 95 103 95 104 95 115 95 115 95 104 95 105 95 115 95 105 95 106 95 100 95 101 95 115 95 115 95 101 95 102 95 115 95 102 95 103 95 97 95 98 95 115 95 115 95 98 95 99 95 115 95 99 95 100 95 116 96 117 96 59 96 59 96 117 96 58 96 118 97 116 97 56 97 56 98 116 98 59 98 119 99 118 99 57 99 57 100 118 100 56 100 117 101 119 101 58 101 58 102 119 102 57 102 118 1 119 1 116 1 116 1 119 1 117 1 120 103 121 103 48 103 48 104 121 104 53 104 122 105 120 105 47 105 47 106 120 106 48 106 123 107 122 107 46 107 46 108 122 108 47 108 121 109 123 109 53 109 53 110 123 110 46 110 122 111 123 111 120 111 120 1 123 1 121 1 124 112 125 112 40 112 40 113 125 113 38 113 126 114 124 114 7 114 7 115 124 115 40 115 127 116 126 116 6 116 6 117 126 117 7 117 125 118 127 118 38 118 38 119 127 119 6 119 126 1 127 1 124 1 124 1 127 1 125 1 128 120 129 120 68 120 68 121 129 121 69 121 130 122 128 122 71 122 71 123 128 123 68 123 131 124 130 124 73 124 73 125 130 125 71 125 129 126 131 126 69 126 69 127 131 127 73 127 130 1 131 1 128 1 128 1 131 1 129 1 132 82 133 82 30 82 30 82 133 82 35 82 28 128 134 128 32 128 32 128 134 128 132 128 32 128 132 128 30 128 135 53 134 53 26 53 26 53 134 53 28 53 35 129 133 129 25 129 25 129 133 129 135 129 25 129 135 129 26 129 134 1 135 1 132 1 132 1 135 1 133 1 136 82 137 82 18 82 18 82 137 82 22 82 13 128 138 128 15 128 15 128 138 128 136 128 15 128 136 128 18 128 139 53 138 53 11 53 11 53 138 53 13 53 22 129 137 129 20 129 20 129 137 129 139 129 20 129 139 129 11 129 138 1 139 1 136 1 136 1 139 1 137 1

+
+
+
+
+ + + + 0.8660254 2.18557e-8 0.5 -0.161191 0.5 -3.78552e-8 -0.8660254 0.043191 0 1 -4.37114e-8 -0.059637 0 0 0 1 + + + + -0.2908646 -0.7711008 0.5663932 4.076245 0.9551712 -0.1998834 0.2183911 1.005454 -0.05518897 0.6045246 0.7946723 5.903862 0 0 0 1 + + + + + + + +
\ No newline at end of file diff --git a/ros/t_top/meshes/stewart_platform_mesh.dae b/ros/t_top/meshes/stewart_platform_mesh.dae new file mode 100644 index 00000000..776fdfd5 --- /dev/null +++ b/ros/t_top/meshes/stewart_platform_mesh.dae @@ -0,0 +1,59 @@ + + + + + Blender User + Blender 2.92.0 commit date:2021-02-24, commit time:16:25, hash:02948a2cab44 + + 2021-05-28T09:30:07 + 2021-05-28T09:30:07 + + Z_UP + + + + + + + 0.1379659 0.05324774 0.135 0.139773 0.06436735 0.135 0.1264669 0.06999999 0.135 0.14 0.06999999 0.135 0.139773 0.07563263 0.135 0.02150923 0.01951581 0.135 0.03023535 0.01239109 0.135 0.04176652 0.02109807 0.135 0.03999137 0.006758451 0.135 0.08400177 0.001414597 0.135 0.09482234 0.004548788 0.135 0.09823346 0.02109807 0.135 0.105 0.009378194 0.135 0.1142712 0.01577752 0.135 0.05052477 0.1372362 0.135 0.03999137 0.1332415 0.135 0.04176652 0.1189017 0.135 0.03023535 0.1276088 0.135 0.003602445 0.09216672 0.135 9.06482e-4 0.08122879 0.135 0.01353293 0.06999999 0.135 0 0.06999999 0.135 9.06482e-4 0.05877119 0.135 0.1223958 0.1164186 0.135 0.1142712 0.1242223 0.135 0.09823346 0.1189017 0.135 0.105 0.1306217 0.135 0.09482234 0.1354511 0.135 0.05052477 0.002763569 0.135 0.06156229 5.1038e-4 0.135 0.07281857 5.67734e-5 0.135 0.08400177 0.1385853 0.135 0.07281857 0.1399432 0.135 0.06156229 0.1394896 0.135 0.1223958 0.02358138 0.135 0.1291633 0.03258723 0.135 0.1343985 0.0425623 0.135 0.1379659 0.08675205 0.135 0.1343985 0.09743762 0.135 0.1291633 0.1074126 0.135 0.003602445 0.0478332 0.135 0.008018076 0.0374692 0.135 0.01403898 0.02794802 0.135 0.02150923 0.1204842 0.135 0.01403898 0.112052 0.135 0.008018076 0.1025305 0.135 0.03023535 0.1276088 0.125 0.03999137 0.1332415 0.125 0.04277521 0.1171547 0.125 0.02150923 0.1204842 0.125 0.03999137 0.006758451 0.125 0.03023535 0.01239109 0.125 0.04277521 0.02284514 0.125 0.1379659 0.08675205 0.125 0.139773 0.07563263 0.125 0.1244496 0.06999999 0.125 0.14 0.06999999 0.125 0.139773 0.06436735 0.125 0.003602445 0.0478332 0.125 9.06482e-4 0.05877119 0.125 0.01555043 0.06999999 0.125 0 0.06999999 0.125 9.06482e-4 0.08122879 0.125 0.05052477 0.002763569 0.125 0.02150923 0.01951581 0.125 0.01403898 0.02794802 0.125 0.008018076 0.0374692 0.125 0.1223958 0.02358138 0.125 0.1142712 0.01577752 0.125 0.09722477 0.02284514 0.125 0.105 0.009378194 0.125 0.09482234 0.004548788 0.125 0.08400177 0.1385853 0.125 0.09482234 0.1354511 0.125 0.09722477 0.1171547 0.125 0.105 0.1306217 0.125 0.1142712 0.1242223 0.125 0.003602445 0.09216672 0.125 0.008018076 0.1025305 0.125 0.01403898 0.112052 0.125 0.08400177 0.001414597 0.125 0.07281857 5.67734e-5 0.125 0.06156229 5.1038e-4 0.125 0.05052477 0.1372362 0.125 0.06156229 0.1394896 0.125 0.07281857 0.1399432 0.125 0.1223958 0.1164186 0.125 0.1291633 0.1074126 0.125 0.1343985 0.09743762 0.125 0.1379659 0.05324774 0.125 0.1343985 0.0425623 0.125 0.1291633 0.03258723 0.125 0.00999999 0.1345676 0 0.00999999 0.1345676 0.1899999 0.00999999 0.1645676 0 0.00999999 0.1645676 0.1899999 0.1299999 0.1345676 0 0.1299999 0.1645676 0 0.1299999 0.1345676 0.1899999 0.1299999 0.1645676 0.1899999 + + + + + + + + + + 1.47234e-6 0 1 0 0 1 -7.76636e-7 0 1 2.7655e-6 0 1 -7.66094e-7 0 1 -1.47233e-6 0 1 -7.76629e-7 0 1 6.91376e-7 0 1 2.94469e-6 0 1 -3.82455e-6 0 1 8.78829e-7 0 1 -1.44939e-7 0 1 2.76549e-6 0 1 -7.24696e-7 0 1 -7.83897e-7 0 1 1.91229e-6 0 1 -3.45687e-7 0 1 -2.54969e-6 0 1 -2.31903e-6 0 1 3.91922e-7 0 1 1.04522e-6 0 1 1.84045e-7 0 1 -8.01116e-7 0 1 2.81227e-6 0 1 -2.31905e-6 0 1 0 0 -1 -1.34878e-6 0 -1 -1.74026e-6 0 -1 -1.31271e-7 0 -1 -3.89435e-7 0 -1 1.7104e-6 0 -1 0.9991888 0.04026979 0 0.9991889 -0.04026985 0 0.9991888 -0.04026967 0 0.9870505 -0.16041 0 0.9870505 -0.1604107 0 0.9485357 -0.3166704 0 0.9485347 -0.3166736 0 0.8854589 -0.4647179 0 0.8854597 -0.4647163 0 0.7994419 -0.6007435 0 0.7994431 -0.6007418 0 0.6927264 -0.7212005 0 0.6927243 -0.7212025 0 0.5680617 -0.822986 0 0.5680611 -0.8229865 0 0.4286963 -0.9034488 0 0.428695 -0.9034493 0 0.2782156 -0.9605187 0 0.2782149 -0.9605189 0 0.1205314 -0.9927095 0 0.120531 -0.9927096 0 -0.04026561 -0.999189 0 -0.04026556 -0.999189 0 -0.2000178 -0.9797924 0 -0.2000179 -0.9797923 0 -0.3546101 -0.9350143 0 -0.3546083 -0.935015 0 -0.5000004 -0.8660253 0 -0.4999983 -0.8660264 0 -0.6324473 -0.7746036 0 -0.6324458 -0.7746047 0 -0.7485135 -0.6631196 0 -0.7485116 -0.6631218 0 -0.8451891 -0.5344676 0 -0.8451884 -0.5344686 0 -0.9199808 -0.3919636 0 -0.9199801 -0.391965 0 -0.9709421 -0.2393145 0 -0.970942 -0.239315 0 -0.9967574 -0.08046644 0 -0.9967574 -0.08046662 0 -0.9967574 0.08046644 0 -0.9967574 0.08046662 0 -0.9709419 0.239316 0 -0.9709417 0.2393164 0 -0.9199783 0.3919696 0 -0.8451954 0.5344574 0 -0.8451949 0.5344582 0 -0.7485125 0.6631208 0 -0.7485117 0.6631217 0 -0.6324408 0.7746087 0 -0.6324398 0.7746096 0 -0.5000038 0.8660233 0 -0.5000035 0.8660236 0 -0.3546001 0.9350181 0 -0.3545992 0.9350184 0 -0.2000308 0.9797896 0 -0.2000306 0.9797897 0 -0.04026436 0.9991891 0 -0.04026418 0.9991891 0 0.1205378 0.9927088 0 0.1205376 0.9927089 0 0.2782159 0.9605185 0 0.2782146 0.960519 0 0.4286966 0.9034485 0 0.4286946 0.9034495 0 0.5680624 0.8229855 0 0.5680617 0.822986 0 0.6927211 0.7212056 0 0.69272 0.7212067 0 0.7994476 0.6007359 0 0.7994441 0.6007405 0 0.8854593 0.4647172 0 0.885458 0.4647196 0 0.9485356 0.3166704 0 0.9485359 0.3166698 0 0.9870502 0.160412 0 0.9870501 0.1604123 0 0.9991889 0.04026985 0 0 -0.9850808 0.1720932 0 -0.9850807 0.1720935 0.8531019 -0.4925401 0.1721089 0.8531043 -0.49254 0.1720976 -0.8531035 -0.4925418 0.1720961 -0.8531048 -0.4925389 0.1720978 0.8531038 0.4925394 0.1721017 0.8531028 0.4925391 0.1721079 -0.8531032 0.4925402 0.172102 -0.8531053 0.4925386 0.172096 0 0.9850795 0.1721003 0 0.9850795 0.1721005 -1 0 0 1 0 0 0 -1 0 0 1 0 + + + + + + + + + + + + + + +

0 0 1 0 2 0 2 1 1 1 3 1 2 1 3 1 4 1 5 1 6 1 7 1 7 2 6 2 8 2 9 3 10 3 11 3 11 1 10 1 12 1 11 4 12 4 13 4 14 5 15 5 16 5 16 6 15 6 17 6 18 1 19 1 20 1 20 1 19 1 21 1 20 1 21 1 22 1 23 7 24 7 25 7 25 1 24 1 26 1 25 1 26 1 27 1 8 8 28 8 7 8 7 9 28 9 29 9 7 1 29 1 11 1 11 10 29 10 30 10 11 11 30 11 9 11 27 12 31 12 25 12 25 13 31 13 32 13 25 1 32 1 16 1 16 14 32 14 33 14 16 15 33 15 14 15 13 16 34 16 11 16 11 1 34 1 35 1 11 1 35 1 2 1 2 1 35 1 36 1 2 17 36 17 0 17 4 1 37 1 2 1 2 1 37 1 38 1 2 1 38 1 25 1 25 1 38 1 39 1 25 1 39 1 23 1 22 1 40 1 20 1 20 18 40 18 41 18 20 19 41 19 7 19 7 20 41 20 42 20 7 1 42 1 5 1 17 21 43 21 16 21 16 1 43 1 44 1 16 22 44 22 20 22 20 23 44 23 45 23 20 24 45 24 18 24 46 25 47 25 48 25 46 25 48 25 49 25 50 26 51 26 52 26 53 25 54 25 55 25 55 25 54 25 56 25 55 25 56 25 57 25 58 25 59 25 60 25 60 25 59 25 61 25 60 25 61 25 62 25 50 25 52 25 63 25 51 25 64 25 52 25 52 25 64 25 65 25 52 25 65 25 60 25 60 27 65 27 66 27 60 25 66 25 58 25 67 25 68 25 69 25 69 25 68 25 70 25 69 25 70 25 71 25 72 25 73 25 74 25 74 25 73 25 75 25 74 25 75 25 76 25 62 25 77 25 60 25 60 25 77 25 78 25 60 25 78 25 48 25 48 25 78 25 79 25 48 25 79 25 49 25 71 25 80 25 69 25 69 28 80 28 81 28 69 25 81 25 52 25 52 29 81 29 82 29 52 30 82 30 63 30 47 25 83 25 48 25 48 25 83 25 84 25 48 25 84 25 74 25 74 25 84 25 85 25 74 25 85 25 72 25 76 25 86 25 74 25 74 25 86 25 87 25 74 25 87 25 55 25 55 25 87 25 88 25 55 25 88 25 53 25 57 25 89 25 55 25 55 25 89 25 90 25 55 25 90 25 69 25 69 25 90 25 91 25 69 25 91 25 67 25 4 31 3 31 56 31 56 32 3 32 57 32 3 33 1 33 57 33 57 34 1 34 0 34 57 35 0 35 89 35 89 36 0 36 36 36 89 37 36 37 90 37 90 38 36 38 35 38 90 39 35 39 91 39 91 40 35 40 34 40 91 41 34 41 67 41 67 42 34 42 13 42 67 43 13 43 68 43 68 44 13 44 12 44 68 45 12 45 70 45 70 46 12 46 10 46 70 47 10 47 71 47 71 48 10 48 9 48 71 49 9 49 80 49 80 50 9 50 30 50 80 51 30 51 81 51 81 52 30 52 29 52 81 53 29 53 82 53 82 54 29 54 28 54 82 55 28 55 63 55 63 56 28 56 8 56 63 57 8 57 50 57 50 58 8 58 6 58 50 59 6 59 51 59 51 60 6 60 5 60 51 61 5 61 64 61 64 62 5 62 42 62 64 63 42 63 65 63 65 64 42 64 41 64 65 65 41 65 66 65 66 66 41 66 40 66 66 67 40 67 58 67 58 68 40 68 22 68 58 69 22 69 59 69 59 70 22 70 21 70 59 71 21 71 61 71 61 72 21 72 19 72 61 73 19 73 62 73 62 74 19 74 18 74 62 75 18 75 77 75 77 76 18 76 45 76 77 76 45 76 78 76 78 77 45 77 44 77 78 78 44 78 79 78 79 79 44 79 43 79 79 80 43 80 49 80 49 81 43 81 17 81 49 82 17 82 46 82 46 83 17 83 15 83 46 84 15 84 47 84 47 85 15 85 14 85 47 86 14 86 83 86 83 87 14 87 33 87 83 88 33 88 84 88 84 89 33 89 32 89 84 90 32 90 85 90 85 91 32 91 31 91 85 92 31 92 72 92 72 93 31 93 27 93 72 94 27 94 73 94 73 95 27 95 26 95 73 96 26 96 75 96 75 97 26 97 24 97 75 98 24 98 76 98 76 99 24 99 23 99 76 100 23 100 86 100 86 101 23 101 39 101 86 102 39 102 87 102 87 103 39 103 38 103 87 104 38 104 88 104 88 105 38 105 37 105 88 106 37 106 53 106 53 107 37 107 4 107 53 108 4 108 54 108 54 109 4 109 56 109 16 110 48 110 25 110 25 111 48 111 74 111 20 112 60 112 16 112 16 113 60 113 48 113 55 114 2 114 74 114 74 115 2 115 25 115 7 116 52 116 20 116 20 117 52 117 60 117 69 118 11 118 55 118 55 119 11 119 2 119 11 120 69 120 7 120 7 121 69 121 52 121 92 122 93 122 94 122 94 122 93 122 95 122 96 25 92 25 97 25 97 25 92 25 94 25 98 123 96 123 99 123 99 123 96 123 97 123 93 1 98 1 95 1 95 1 98 1 99 1 96 124 98 124 92 124 92 124 98 124 93 124 99 125 97 125 95 125 95 125 97 125 94 125

+
+
+
+
+ + + + -4.37114e-8 1 -1.50996e-7 -0.07 1 4.37114e-8 -6.60024e-15 -0.07 0 -1.50996e-7 -1 0.130416 0 0 0 1 + + + + + + + +
\ No newline at end of file diff --git a/ros/t_top/package.xml b/ros/t_top/package.xml index 65963807..b99437ce 100644 --- a/ros/t_top/package.xml +++ b/ros/t_top/package.xml @@ -68,6 +68,7 @@ rospy sensor_msgs std_msgs + opentera_webrtc_ros_msgs tf hbba_lite diff --git a/ros/t_top/rviz/urdf.rviz b/ros/t_top/rviz/urdf.rviz index 690b9466..1fc1e3cc 100644 --- a/ros/t_top/rviz/urdf.rviz +++ b/ros/t_top/rviz/urdf.rviz @@ -13,6 +13,7 @@ Panels: - /MapCloud1 - /MarkerArray1 - /PoseArray1 + - /Map1 Splitter Ratio: 0.6360294222831726 Tree Height: 741 - Class: rviz/Selection @@ -180,7 +181,7 @@ Visualization Manager: Size (Pixels): 3 Size (m): 0.009999999776482582 Style: Flat Squares - Topic: /rtabmap/cloud_map + Topic: /cloud_map Unreliable: false Use Fixed Frame: true Use rainbow: true @@ -203,6 +204,7 @@ Visualization Manager: Color Transformer: RGB8 Download graph: false Download map: false + Download namespace: "" Enabled: true Filter ceiling (m): 0 Filter floor (m): 0 @@ -219,7 +221,7 @@ Visualization Manager: Size (Pixels): 3 Size (m): 0.009999999776482582 Style: Flat Squares - Topic: /rtabmap/mapData + Topic: /mapData Unreliable: false Use Fixed Frame: true Use rainbow: true @@ -249,6 +251,16 @@ Visualization Manager: Topic: /sst_poses Unreliable: false Value: true + - Alpha: 0.699999988079071 + Class: rviz/Map + Color Scheme: map + Draw Behind: false + Enabled: true + Name: Map + Topic: /grid_map + Unreliable: false + Use Timestamp: false + Value: true Enabled: true Global Options: Background Color: 48; 48; 48 diff --git a/ros/t_top/scripts/opencr_raw_data_interpreter.py b/ros/t_top/scripts/opencr_raw_data_interpreter.py index 5772ffa0..ee4c6a4d 100755 --- a/ros/t_top/scripts/opencr_raw_data_interpreter.py +++ b/ros/t_top/scripts/opencr_raw_data_interpreter.py @@ -8,24 +8,17 @@ from sensor_msgs.msg import Imu from sensor_msgs.msg import MagneticField from geometry_msgs.msg import PoseStamped -from nav_msgs.msg import Odometry class OpenCrRawDataInterpreter: def __init__(self): - self._rate = rospy.Rate(15) - self._base_footprint_torso_base_delta_z = rospy.get_param('~base_link_torso_base_delta_z', 0.0) self._tf_broadcaster = tf.TransformBroadcaster() - self._tf_listener = tf.TransformListener() - self._imu_pub = rospy.Publisher('opencr_imu/data_raw', Imu, queue_size=5) self._mag_pub = rospy.Publisher('opencr_imu/mag', MagneticField, queue_size=5) - self._odom_pub = rospy.Publisher('opencr/odom', Odometry, queue_size=5) - self._raw_imu_sub = rospy.Subscriber('opencr/raw_imu', Float32MultiArray, self._raw_imu_cb, queue_size=5) self._current_torso_orientation_sub = rospy.Subscriber('opencr/current_torso_orientation', @@ -47,13 +40,13 @@ def _raw_imu_cb(self, raw_imu): imu_msg.angular_velocity.z = raw_imu.data[5] self._imu_pub.publish(imu_msg) - magnetic_field = MagneticField() - magnetic_field.header.stamp = now - magnetic_field.header.frame_id = 'opencr_imu' - magnetic_field.magnetic_field.x = raw_imu.data[6] - magnetic_field.magnetic_field.y = raw_imu.data[7] - magnetic_field.magnetic_field.z = raw_imu.data[8] - self._imu_pub.publish(imu_msg) + mag_msg = MagneticField() + mag_msg.header.stamp = now + mag_msg.header.frame_id = 'opencr_imu' + mag_msg.magnetic_field.x = raw_imu.data[6] + mag_msg.magnetic_field.y = raw_imu.data[7] + mag_msg.magnetic_field.z = raw_imu.data[8] + self._mag_pub.publish(mag_msg) def _current_torso_orientation_cb(self, orientation): now = rospy.Time.now() @@ -67,41 +60,8 @@ def _current_head_pose_cb(self, pose): quaternion = (pose.pose.orientation.x, pose.pose.orientation.y, pose.pose.orientation.z, pose.pose.orientation.w) self._tf_broadcaster.sendTransform(translation, quaternion, now, 'head', pose.header.frame_id) - def _send_odom(self, trans, ori): - odom_msg = Odometry() - odom_msg.header.frame_id = 'base_link' - odom_msg.header.stamp = rospy.Time.now() - odom_msg.child_frame_id = 'camera_depth_optical_frame' - - odom_msg.pose.pose.position.x = trans[0] - odom_msg.pose.pose.position.y = trans[1] - odom_msg.pose.pose.position.z = trans[2] - - odom_msg.pose.pose.orientation.x = ori[0] - odom_msg.pose.pose.orientation.y = ori[1] - odom_msg.pose.pose.orientation.z = ori[2] - odom_msg.pose.pose.orientation.w = ori[3] - - # From stewart_simulator - odom_msg.pose.covariance = [1.29593696e-07, -3.02490686e-09, -2.34185217e-09, 3.43909522e-08, -1.76583062e-07, 5.85076793e-09, - -3.02490686e-09, 1.25348464e-07, 4.17541942e-09, 1.95763784e-07, -1.30688450e-08, 3.89092298e-08, - -2.34185217e-09, 4.17541942e-09, 8.27253806e-08, 4.62811502e-10, 3.30862971e-09, -1.41326028e-08, - 3.43909522e-08, 1.95763784e-07, 4.62811502e-10, 1.14239749e-05, 3.26955028e-08, 2.41604671e-07, - -1.76583062e-07, -1.30688450e-08, 3.30862971e-09, 3.26955028e-08, 1.07156371e-05, -2.98094285e-07, - 5.85076793e-09, 3.89092298e-08, -1.41326028e-08, 2.41604671e-07, -2.98094285e-07, 1.20712896e-05] - - self._odom_pub.publish(odom_msg) - def run(self): - while not rospy.is_shutdown(): - self._rate.sleep() - - try: - (trans, ori) = self._tf_listener.lookupTransform('/camera_depth_optical_frame', '/base_link', rospy.Time(0)) - except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException): - continue - - self._send_odom(trans, ori) + rospy.spin() def main(): diff --git a/ros/t_top/scripts/robot_status.py b/ros/t_top/scripts/robot_status.py new file mode 100755 index 00000000..d8fd26d3 --- /dev/null +++ b/ros/t_top/scripts/robot_status.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python3 + +import rospy +import psutil +import os +import re +import json +from opentera_webrtc_ros_msgs.msg import RobotStatus +from std_msgs.msg import String, Float32MultiArray +from subprocess import Popen, PIPE +from typing import List, Optional, Union +from threading import Lock + + +def clamp(value: float, min_value: float, max_value: float) -> float: + return max(min(value, max_value), min_value) + + +class BaseStatus: + def __init__(self, + percentage: Optional[float] = None, + voltage: Optional[float] = None, + current: Optional[float] = None, + is_plugged_in: Optional[Union[bool, float]] = None, + is_charging: Optional[Union[bool, float]] = None) -> None: + self.percentage = clamp(percentage or 0.0, 0, 100) + self.voltage = voltage or 0.0 + self.current = current or 0.0 + self.is_plugged_in = bool( + is_plugged_in) if is_plugged_in is not None else False + self.is_charging = bool( + is_charging) if is_charging is not None else False + + +def get_command_output(cmd: List[str]) -> str: + p = Popen(cmd, stdout=PIPE) + return p.communicate()[0].decode('utf-8') + + +class RobotStatusPublisher(): + def __init__(self): + rospy.init_node("robot_status_publisher") + + self.base_status = BaseStatus() + self.base_status_lock = Lock() + self.pub_rate = 1 + + self.status_pub = rospy.Publisher( + '/robot_status', RobotStatus, queue_size=10) + self.status_webrtc_pub = rospy.Publisher( + '/webrtc_data_outgoing', String, queue_size=10) + + self.base_status_sub = rospy.Subscriber( + "/opencr/base_status", + Float32MultiArray, self.base_status_cb, queue_size=1) + + def get_ip_address(self, ifname: str): + try: + address = get_command_output(["ip", "addr", "show", ifname]).split( + "inet ")[1].split("/")[0] + except Exception: + address = '127.0.0.1' + + return address + + def get_disk_usage(self, mount_point='/'): + result = os.statvfs(mount_point) + total_blocks = result.f_blocks + free_blocks = result.f_bfree + return 100 - (free_blocks * 100 / total_blocks) + + def base_status_cb(self, msg): + with self.base_status_lock: + self.base_status = BaseStatus(*msg.data) + + def run(self): + rate = rospy.Rate(self.pub_rate) + while not rospy.is_shutdown(): + # Fill timestamp + status = RobotStatus() + status.header.stamp = rospy.Time.now() + + # Fill robot info + with self.base_status_lock: + status.battery_voltage = self.base_status.voltage + status.battery_current = self.base_status.current + status.battery_level = self.base_status.percentage + status.is_charging = self.base_status.is_plugged_in + + status.cpu_usage = psutil.cpu_percent() + status.mem_usage = psutil.virtual_memory().percent + status.disk_usage = self.get_disk_usage() + + status.wifi_network = get_command_output(["iwgetid"]) + if status.wifi_network: + wifi_interface_name = status.wifi_network.split()[0] + + wifi_usage = get_command_output( + ["iwconfig", wifi_interface_name]) + wifi_strength_re = re.search( + r'Link Quality=(\d+)/(\d+)', wifi_usage) + if wifi_strength_re is not None and len(wifi_strength_re.groups()) == 2: + numerator = int(wifi_strength_re.group(1)) + denominator = int(wifi_strength_re.group(2)) + else: + numerator, denominator = (0, 1) + status.wifi_strength = numerator / denominator * 100 + status.local_ip = self.get_ip_address(wifi_interface_name) + else: + status.wifi_strength = 0 + status.local_ip = '127.0.0.1' + + # TODO Get data about mute and camera status from webrtc when it is implemented + status.is_muted = False + status.is_camera_on = True + + # Publish for webrtc + status_dict = { + 'type': 'robotStatus', + 'timestamp': status.header.stamp.secs, + 'status': { + 'isCharging': status.is_charging, + 'batteryVoltage': status.battery_voltage, + 'batteryCurrent': status.battery_current, + 'batteryLevel': status.battery_level, + 'cpuUsage': status.cpu_usage, + 'memUsage': status.mem_usage, + 'diskUsage': status.disk_usage, + 'wifiNetwork': status.wifi_network, + 'wifiStrength': status.wifi_strength, + 'localIp': status.local_ip, + 'isMuted': status.is_muted, + 'isCameraOn': status.is_camera_on + } + } + self.status_webrtc_pub.publish(json.dumps(status_dict)) + + # Publish + self.status_pub.publish(status) + + rate.sleep() + + +if __name__ == '__main__': + print("Robot Status Publisher Starting") + try: + robot_status = RobotStatusPublisher() + robot_status.run() + except rospy.ROSInterruptException: + pass diff --git a/ros/t_top/urdf/ttop.urdf.xacro b/ros/t_top/urdf/ttop.urdf.xacro index 2e26d0e7..5d237887 100644 --- a/ros/t_top/urdf/ttop.urdf.xacro +++ b/ros/t_top/urdf/ttop.urdf.xacro @@ -45,14 +45,14 @@ - + - + @@ -67,7 +67,7 @@ - + @@ -75,7 +75,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -104,7 +104,7 @@ - + diff --git a/ros/t_top_hbba_lite/src/Strategies.cpp b/ros/t_top_hbba_lite/src/Strategies.cpp index 8d3ad2e6..5163c4e5 100644 --- a/ros/t_top_hbba_lite/src/Strategies.cpp +++ b/ros/t_top_hbba_lite/src/Strategies.cpp @@ -240,9 +240,7 @@ unique_ptr createTelepresenceStrategy(std::shared_ptr return make_unique>( utility, unordered_map{{"sound", 1}}, - unordered_map{ - {"rtabmap/filter_state", FilterConfiguration::onOff()}, - }, + unordered_map{}, move(filterPool)); } diff --git a/tools/README.md b/tools/README.md index c7485bb9..7a30fcb2 100644 --- a/tools/README.md +++ b/tools/README.md @@ -9,3 +9,4 @@ This folder contains the tools to develop and use the robot. - The [odas_configuration_generators](odas_configuration_generator) folder contains a tool to generate the microphone configuration for [ODAS](https://github.com/introlab/odas). - The [stewart_simulator](stewart_simulator) folder contains a tool to design the Stewart platform. +- The [ca_certificates](ca_certificates) folder contains tools to generate CA certificates and keys. diff --git a/tools/ca_certificates/ca_certificate_setup.md b/tools/ca_certificates/ca_certificate_setup.md new file mode 100755 index 00000000..06ab9400 --- /dev/null +++ b/tools/ca_certificates/ca_certificate_setup.md @@ -0,0 +1,44 @@ +# Generating CA Certificates for the robot + +## 1. Generate CA Certificates on the robot +You need to generate a CA certificate for the robot to allow for HTTPS connections to the robot on the local network. +It will be tied to its IP address on the LAN, so make sure to give the robot a static IP address before generating the certificate. +Make sure to replace the `` placeholder with the IP address of the robot in the command below. + +```bash +# Run this script on the robot +./generate_certificate.sh +``` + +This will need to be done again when the certificate expires, after 365 days. + +## 2. Copy the CA certificate to the developpement machine +If the developpement machine is using Ubuntu, you can use a script to install the certificate. The script uses `scp` to copy the certificate to the developpement machine, so you will need the password for the `introlab` user on the robot if you don't have an ssh key setup. +Make sure to replace the `` placeholder with the IP address of the robot (for SSH) and the `` placeholder with the name of the robot (for the certificate file name, to distinguish it from files from other robots). + +```bash +# Run this script on the developpement machine +./fetch_certificate.sh +``` + +This step can be done by many developpers without the need to redo step one every time, but it will have to be redone if step 1 is done again. + +## 3. Add the CA certificate to your browser +The certificate installed on your system is not enough for your browser to trust it. +You need to add the certificate to your browser. + +Open your browser's settings, and find the CA Certificates setting. Add the ca-certificate `/usr/local/share/ca-sertificates/-ca-cert.crt` as a trusted certificate. + +### Firefox +1. Open the Preferences menu +2. Search for "certif" +3. Click on the "Show Certificates" button +4. Go to the "Authorities" tab +5. Click on the "Import" button +6. Select the certificate file + +### Chromium (Chrome, Brave, etc.) +1. Navigate to the URL ̀chrome://settings/certificates` +2. Go to the "Authorities" tab +3. Click on the "Import" button +4. Select the certificate file diff --git a/tools/ca_certificates/fetch_certificate.sh b/tools/ca_certificates/fetch_certificate.sh new file mode 100755 index 00000000..598d4a87 --- /dev/null +++ b/tools/ca_certificates/fetch_certificate.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Get the robot IP and name from the command line +IP=$1 +NAME=$2 + +# Fetch CA certificate from the robot +scp introlab@$IP:/home/introlab/.ros/opentera/certs/ca-cert.pem /tmp/ca-cert.pem + +# Move to installation folder +sudo mv /tmp/ca-cert.pem /usr/local/share/ca-certificates/$NAME-ca-cert.crt + +# Install certificate +sudo update-ca-certificates --fresh diff --git a/tools/ca_certificates/generate_certificate.sh b/tools/ca_certificates/generate_certificate.sh new file mode 100755 index 00000000..4f9eaefc --- /dev/null +++ b/tools/ca_certificates/generate_certificate.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Get the robot IP from the command line +IP=$1 + +# Move to directory +mkdir -p ~/.ros/opentera/certs +pushd ~/.ros/opentera/certs > /dev/null + +# Remove old certificate +rm ca-cert.pem ca-key.pem server-req.pem server-key.pem server-cert.pem + +# 1. Generate CA's private key and self-signed certificate +openssl req -x509 -newkey rsa:4096 -days 365 -keyout ca-key.pem -out ca-cert.pem -subj "/C=CA/ST=Quebec/L=Sherbrooke/O=IntRoLab" -passout "pass:introlab" + +# 2. Create a certificate request for the server +# Make sure that the IP address match the robot's IP address +openssl req -newkey rsa:4096 -keyout server-key.pem -out server-req.pem -subj "/C=CA/ST=Quebec/L=Sherbrooke/O=IntRoLab/CN=$IP" -nodes + +# 3. Sign server request using CA's private key and certificate +openssl x509 -req -in server-req.pem -days 365 -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem -passin "pass:introlab" + +echo "Server certificate validity test:" +openssl verify -CAfile ca-cert.pem server-cert.pem + +# You can now copy the ca-cert.pem to the target machine +# Then, rename the ca-cert.pem file to -ca-cert.crt +# Copy it to /usr/local/share/ca-sertificates +# Update the certificates using 'sudo update-ca-certificates --fresh' + +popd > /dev/null