Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
a5a1b5cb51afa766e7c9f72fbba2f79a858641c2
975eb13a66bcf2e50525886453b40dd48b3b168f
874863ef235c3713aa1f50b507cb9017afdba0f5
45e252ecd15849f7794de05dae7cbea0382a48a1
ba13aadddd9356fc92d6fb998aafe59c485b468b
45e252ecd15849f7794de05dae7cbea0382a48a1
8 changes: 0 additions & 8 deletions Jenkinsfile

This file was deleted.

18 changes: 0 additions & 18 deletions bitbots_buttons/.rdmanifest

This file was deleted.

3 changes: 0 additions & 3 deletions bitbots_buttons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ find_package(backward_ros REQUIRED)
find_package(bitbots_docs REQUIRED)
find_package(bitbots_msgs REQUIRED)
find_package(bitbots_localization REQUIRED)
find_package(humanoid_league_msgs REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_srvs REQUIRED)
find_package(test_msgs REQUIRED)
Expand All @@ -23,7 +22,6 @@ ament_target_dependencies(button_node
backward_ros
bitbots_msgs
bitbots_localization
humanoid_league_msgs
rclcpp
std_msgs
std_srvs
Expand All @@ -41,7 +39,6 @@ ament_export_dependencies(std_msgs)
ament_export_dependencies(ament_cmake)
ament_export_dependencies(bitbots_docs)
ament_export_dependencies(bitbots_msgs)
ament_export_dependencies(humanoid_league_msgs)
ament_export_dependencies(std_msgs)
ament_export_include_directories(${INCLUDE_DIRS})

Expand Down
3 changes: 1 addition & 2 deletions bitbots_buttons/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

<depend>backward_ros</depend>
<depend>bitbots_docs</depend>
<depend>bitbots_msgs</depend>
<depend>bitbots_localization</depend>
<depend>humanoid_league_msgs</depend>
<depend>bitbots_msgs</depend>
<depend>rclcpp</depend>
<depend>std_msgs</depend>
<depend>std_srvs</depend>
Expand Down
8 changes: 4 additions & 4 deletions bitbots_buttons/src/button_node.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <signal.h>

#include <bitbots_localization/srv/reset_filter.hpp>
#include <bitbots_msgs/msg/audio.hpp>
#include <bitbots_msgs/msg/buttons.hpp>
#include <bitbots_msgs/srv/manual_penalize.hpp>
#include <humanoid_league_msgs/msg/audio.hpp>
#include <rclcpp/experimental/executors/events_executor/events_executor.hpp>
#include <rclcpp/rclcpp.hpp>
#include <std_msgs/msg/bool.hpp>
Expand Down Expand Up @@ -41,7 +41,7 @@ class ButtonNode : public rclcpp::Node {
button3_time_ = 0.0;

// --- Initialize Topics ---
speak_pub_ = this->create_publisher<humanoid_league_msgs::msg::Audio>("/speak", 1);
speak_pub_ = this->create_publisher<bitbots_msgs::msg::Audio>("/speak", 1);
shoot_publisher_ = this->create_publisher<std_msgs::msg::Bool>("/shoot_button", 1);

if (manual_penalty_mode_) {
Expand Down Expand Up @@ -176,7 +176,7 @@ class ButtonNode : public rclcpp::Node {
* Helper method to send a message for text-to-speech output
*/
if (speak_) {
humanoid_league_msgs::msg::Audio msg = humanoid_league_msgs::msg::Audio();
bitbots_msgs::msg::Audio msg = bitbots_msgs::msg::Audio();
msg.text = text;
msg.priority = 100;
speak_pub_->publish(msg);
Expand All @@ -199,7 +199,7 @@ class ButtonNode : public rclcpp::Node {
double button2_time_;
double button3_time_;

rclcpp::Publisher<humanoid_league_msgs::msg::Audio>::SharedPtr speak_pub_;
rclcpp::Publisher<bitbots_msgs::msg::Audio>::SharedPtr speak_pub_;
rclcpp::Publisher<std_msgs::msg::Bool>::SharedPtr shoot_publisher_;
rclcpp::Client<bitbots_msgs::srv::ManualPenalize>::SharedPtr manual_penalize_client_;
rclcpp::Client<std_srvs::srv::Empty>::SharedPtr foot_zero_client_;
Expand Down
4 changes: 0 additions & 4 deletions bitbots_ros_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ find_package(controller_manager REQUIRED)
find_package(diagnostic_msgs REQUIRED)
find_package(dynamixel_workbench_toolbox REQUIRED)
find_package(hardware_interface REQUIRED)
find_package(humanoid_league_msgs REQUIRED)
find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(realtime_tools REQUIRED)
Expand Down Expand Up @@ -62,7 +61,6 @@ ament_target_dependencies(ros_control
diagnostic_msgs
dynamixel_workbench_toolbox
hardware_interface
humanoid_league_msgs
pluginlib
rclcpp
realtime_tools
Expand All @@ -85,7 +83,6 @@ ament_target_dependencies(pressure_converter
diagnostic_msgs
dynamixel_workbench_toolbox
hardware_interface
humanoid_league_msgs
pluginlib
rclcpp
realtime_tools
Expand All @@ -105,7 +102,6 @@ ament_export_dependencies(controller_interface)
ament_export_dependencies(controller_manager)
ament_export_dependencies(dynamixel_workbench_toolbox)
ament_export_dependencies(hardware_interface)
ament_export_dependencies(humanoid_league_msgs)
ament_export_dependencies(pluginlib)
ament_export_dependencies(realtime_tools)
ament_export_dependencies(std_msgs)
Expand Down
14 changes: 7 additions & 7 deletions bitbots_ros_control/config/analyzers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ analyzers:
startswith: [ 'DS']
timeout: 0.2
find_and_remove_prefix: ['DS']
#Pressure:
# type: diagnostic_aggregator/GenericAnalyzer
# path: Pressure
# startswith: ['PS']
# timeout: 0.2
# find_and_remove_prefix: ['PS']
Core:
type: diagnostic_aggregator/GenericAnalyzer
path: Core
Expand Down Expand Up @@ -43,4 +37,10 @@ analyzers:
path: System
startswith: ['SYSTEM']
timeout: 1.0
find_and_remove_prefix: ['SYSTEM']
find_and_remove_prefix: ['SYSTEM']
#Pressure:
# type: diagnostic_aggregator/GenericAnalyzer
# path: Pressure
# startswith: ['PS']
# timeout: 0.2
# find_and_remove_prefix: ['PS']
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <bitbots_ros_control/hardware_interface.hpp>
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
#include <diagnostic_msgs/msg/diagnostic_status.hpp>
#include <humanoid_league_msgs/msg/audio.hpp>
#include <rclcpp/rclcpp.hpp>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
#include <diagnostic_msgs/msg/diagnostic_status.hpp>
#include <hardware_interface/sensor_interface.hpp>
#include <humanoid_league_msgs/msg/audio.hpp>
#include <rclcpp/rclcpp.hpp>
#include <string>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class CoreHardwareInterface : public bitbots_ros_control::HardwareInterface {

std::shared_ptr<DynamixelDriver> driver_;

// always keep the lasts values to check if they different
std::vector<std::vector<double>> current_pressure_;

int id_;
int read_rate_;
int read_counter_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <bitset>
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
#include <diagnostic_msgs/msg/diagnostic_status.hpp>
#include <humanoid_league_msgs/msg/audio.hpp>
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/joint_state.hpp>
#include <std_msgs/msg/bool.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ class ImuHardwareInterface : public bitbots_ros_control::HardwareInterface {
rclcpp::Service<bitbots_msgs::srv::SetAccelerometerCalibrationThreshold>::SharedPtr
set_accel_calib_threshold_service_;

rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_pub_;
rclcpp::Publisher<diagnostic_msgs::msg::DiagnosticArray>::SharedPtr diagnostic_pub_;
sensor_msgs::msg::Imu imu_msg_;

int diag_counter_;

void setIMURanges(const std::shared_ptr<bitbots_msgs::srv::IMURanges::Request> req,
std::shared_ptr<bitbots_msgs::srv::IMURanges::Response> resp);
void calibrateGyro(const std::shared_ptr<std_srvs::srv::Empty::Request> req,
Expand All @@ -94,10 +100,6 @@ class ImuHardwareInterface : public bitbots_ros_control::HardwareInterface {
void setAccelCalibrationThreshold(
const std::shared_ptr<bitbots_msgs::srv::SetAccelerometerCalibrationThreshold::Request> req,
std::shared_ptr<bitbots_msgs::srv::SetAccelerometerCalibrationThreshold::Response> resp);
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_pub_;
rclcpp::Publisher<diagnostic_msgs::msg::DiagnosticArray>::SharedPtr diagnostic_pub_;
sensor_msgs::msg::Imu imu_msg_;
int diag_counter_;
};
} // namespace bitbots_ros_control
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ class LedsHardwareInterface : public bitbots_ros_control::HardwareInterface {
rclcpp::Subscription<std_msgs::msg::ColorRGBA>::SharedPtr sub2_;
};
} // namespace bitbots_ros_control
#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class PressureConverter {
rclcpp::Publisher<bitbots_msgs::msg::FootPressure>::SharedPtr filtered_pub_;
rclcpp::Publisher<geometry_msgs::msg::PointStamped>::SharedPtr cop_pub_;
std::vector<rclcpp::Publisher<geometry_msgs::msg::WrenchStamped>::SharedPtr> wrench_pubs_;
std::vector<std::string> wrench_frames_;
rclcpp::Subscription<bitbots_msgs::msg::FootPressure>::SharedPtr sub_;
std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;

std::vector<std::string> wrench_frames_;
std::vector<double> zero_, scale_;
std::vector<std::vector<double>> previous_values_, zero_and_scale_values_;
bool save_zero_and_scale_values_;
Expand All @@ -38,10 +38,12 @@ class PressureConverter {
double cop_threshold_;
char side_;
std::string req_type_;
std::shared_ptr<bitbots_msgs::srv::FootScale::Request> request_;
std::string scale_lr_, zero_lr_, cop_lr_, sole_lr_;
std::shared_ptr<bitbots_msgs::srv::FootScale::Request> request_;

rclcpp::Service<std_srvs::srv::Empty>::SharedPtr zero_service_;
rclcpp::Service<bitbots_msgs::srv::FootScale>::SharedPtr scale_service_;

void pressureCallback(bitbots_msgs::msg::FootPressure pressure_raw);
void resetZeroAndScaleValues();
bool zeroCallback(const std::shared_ptr<std_srvs::srv::Empty::Request> req,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

#include <dynamixel_driver.h>

#include <bitbots_msgs/msg/audio.hpp>
#include <bitbots_msgs/msg/joint_torque.hpp>
#include <bitbots_ros_control/hardware_interface.hpp>
#include <bitbots_ros_control/utils.hpp>
#include <bitset>
#include <diagnostic_msgs/msg/diagnostic_array.hpp>
#include <diagnostic_msgs/msg/diagnostic_status.hpp>
#include <humanoid_league_msgs/msg/audio.hpp>
#include <rcl_interfaces/msg/list_parameters_result.hpp>
#include <rclcpp/rclcpp.hpp>
#include <sensor_msgs/msg/joint_state.hpp>
Expand Down Expand Up @@ -122,7 +122,7 @@ class ServoBusInterface : public bitbots_ros_control::HardwareInterface {
int reading_errors_;
int reading_successes_;
rclcpp::Publisher<diagnostic_msgs::msg::DiagnosticArray>::SharedPtr diagnostic_pub_;
rclcpp::Publisher<humanoid_league_msgs::msg::Audio>::SharedPtr speak_pub_;
rclcpp::Publisher<bitbots_msgs::msg::Audio>::SharedPtr speak_pub_;
};
} // namespace bitbots_ros_control
#endif // BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_SERVO_BUS_INTERFACE_H_
8 changes: 4 additions & 4 deletions bitbots_ros_control/include/bitbots_ros_control/utils.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#ifndef BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_UTILS_H_
#define BITBOTS_ROS_CONTROL_INCLUDE_BITBOTS_ROS_CONTROL_UTILS_H_

#include "humanoid_league_msgs/msg/audio.hpp"
#include "bitbots_msgs/msg/audio.hpp"
#include "rclcpp/rclcpp.hpp"

namespace bitbots_ros_control {

enum ControlMode { POSITION_CONTROL, VELOCITY_CONTROL, EFFORT_CONTROL, CURRENT_BASED_POSITION_CONTROL };

bool stringToControlMode(rclcpp::Node::SharedPtr nh, const std::string &control_modestr, ControlMode &control_mode);
void speakError(rclcpp::Publisher<humanoid_league_msgs::msg::Audio>::SharedPtr speak_pub, const std::string &text);
bool stringToControlMode(rclcpp::Node::SharedPtr nh, const std::string& control_modestr, ControlMode& control_mode);
void speakError(rclcpp::Publisher<bitbots_msgs::msg::Audio>::SharedPtr speak_pub, const std::string& text);

uint16_t dxlMakeword(uint64_t a, uint64_t b);
uint32_t dxlMakedword(uint64_t a, uint64_t b);
float dxlMakeFloat(uint8_t *data);
float dxlMakeFloat(uint8_t* data);

std::string gyroRangeToString(uint8_t range);
std::string accelRangeToString(uint8_t range);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class WolfgangHardwareInterface {
// two dimensional list of all hardware interfaces, sorted by port
std::vector<std::vector<bitbots_ros_control::HardwareInterface *>> interfaces_;
DynamixelServoHardwareInterface servo_interface_;
rclcpp::Publisher<humanoid_league_msgs::msg::Audio>::SharedPtr speak_pub_;
rclcpp::Publisher<bitbots_msgs::msg::Audio>::SharedPtr speak_pub_;

// prevent unnecessary error when power is turned on
bool first_ping_error_;
Expand Down
14 changes: 8 additions & 6 deletions bitbots_ros_control/launch/ros_control_standalone.launch
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
<arg name="only_pressure" default="false"/>
<arg name="robot_type" default="wolfgang"/>

<group>
<include file="$(find-pkg-share bitbots_utils)/launch/base.launch" >
<arg name="sim" value="$(var sim)"/>
<arg name="robot_type" value="$(var robot_type)"/>
</include>
<include file="$(find-pkg-share bitbots_utils)/launch/parameter_blackboard.launch" >
<arg name="sim" value="$(var sim)"/>
</include>

<include file="$(find-pkg-share bitbots_robot_description)/launch/load_robot_description.launch" >
<arg name="sim" value="$(var sim)"/>
<arg name="robot_type" value="$(var robot_type)"/>
</include>

<include file="$(find-pkg-share bitbots_ros_control)/launch/ros_control.launch">
<arg name="sim" value="$(var sim)"/>
<arg name="torqueless_mode" value="$(var torqueless_mode)"/>
<arg name="only_imu" value="$(var only_imu)"/>
<arg name="only_pressure" value="$(var only_pressure)"/>
</include>
</group>
</launch>
5 changes: 0 additions & 5 deletions bitbots_ros_control/launch/rviz_interactive_imu.launch

This file was deleted.

7 changes: 4 additions & 3 deletions bitbots_ros_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
<depend>bitbots_buttons</depend>
<depend>bitbots_docs</depend>
<depend>bitbots_msgs</depend>
<depend>dynamixel_workbench_toolbox</depend>
<depend>bitbots_robot_description</depend>
<depend>bitbots_utils</depend>
<depend>controller_interface</depend>
<depend>controller_manager</depend>
<depend>dynamixel_workbench_toolbox</depend>
<depend>hardware_interface</depend>
<depend>humanoid_league_msgs</depend>
<depend>humanoid_league_speaker</depend>
<depend>pluginlib</depend>
<depend>realtime_tools</depend>
<depend>rclcpp</depend>
<depend>realtime_tools</depend>
<depend>std_msgs</depend>
<depend>system_monitor</depend>
<depend>transmission_interface</depend>
Expand Down
27 changes: 4 additions & 23 deletions bitbots_ros_control/scripts/battery_led.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,10 @@

pub = node.create_publisher(ColorRGBA, "/led2", 1)

led_full = ColorRGBA()
led_full.a = 1.0
led_full.r = 0.0
led_full.g = 0.0
led_full.b = 1.0

led_mid = ColorRGBA()
led_mid.a = 1.0
led_mid.r = 0.0
led_mid.g = 1.0
led_mid.b = 0.0

led_low = ColorRGBA()
led_low.a = 1.0
led_low.r = 1.0
led_low.g = 0.0
led_low.b = 0.0

led_no = ColorRGBA()
led_no.a = 1.0
led_no.r = 0.0
led_no.g = 0.0
led_no.b = 0.0
led_full = ColorRGBA(a=1.0, r=0.0, g=0.0, b=1.0)
led_mid = ColorRGBA(a=1.0, r=0.0, g=1.0, b=0.0)
led_low = ColorRGBA(a=1.0, r=1.0, g=0.0, b=0.0)
led_no = ColorRGBA(a=1.0, r=0.0, g=0.0, b=0.0)


def vbat_cb(msg: Float64):
Expand Down
Loading