Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noetic devel #134

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion baxter_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ find_package(gazebo REQUIRED)
catkin_package(
CATKIN_DEPENDS
baxter_core_msgs
gazebo_ros
gazebo_ros_control
roscpp
controller_manager_msgs
DEPENDS
gazebo
)

link_directories(
Expand Down
2 changes: 1 addition & 1 deletion baxter_gazebo/launch/baxter_world.launch
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
to launching baxter_world -->
<arg name="load_robot_description" default="true"/>
<param if="$(arg load_robot_description)" name="robot_description"
command="$(find xacro)/xacro.py --inorder $(find baxter_description)/urdf/baxter.urdf.xacro gazebo:=true"/>
command="$(find xacro)/xacro $(find baxter_description)/urdf/baxter.urdf.xacro gazebo:=true"/>

<!-- We resume the logic in empty_world.launch, changing the name of the world to be launched -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
Expand Down
1 change: 1 addition & 0 deletions baxter_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<build_depend>baxter_core_msgs</build_depend>
<build_depend>gazebo_ros_control</build_depend>
<build_depend>controller_manager_msgs</build_depend>
<build_depend>gazebo_ros</build_depend>

<run_depend>roscpp</run_depend>
<run_depend>tf2_ros</run_depend>
Expand Down
2 changes: 1 addition & 1 deletion baxter_sim_controllers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ catkin_package(
control_toolbox
effort_controllers
baxter_core_msgs
DEPENDS yaml-cpp
DEPENDS
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)
Expand Down
2 changes: 1 addition & 1 deletion baxter_sim_hardware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ find_package(Boost REQUIRED COMPONENTS system)
find_package(cmake_modules REQUIRED)
find_package(OpenCV REQUIRED)

find_package(Eigen REQUIRED)
find_package(Eigen3 REQUIRED)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
Expand Down
2 changes: 1 addition & 1 deletion baxter_sim_hardware/src/baxter_emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ void baxter_emulator::publish(const std::string &img_path) {
// Read OpenCV Mat image and convert it to ROS message
cv_bridge::CvImagePtr cv_ptr(new cv_bridge::CvImage);
try {
cv_ptr->image = cv::imread(img_path, CV_LOAD_IMAGE_UNCHANGED);
cv_ptr->image = cv::imread(img_path, cv::IMREAD_UNCHANGED);
if (cv_ptr->image.data) {
cv_ptr->encoding = sensor_msgs::image_encodings::BGR8;
sleep(IMG_LOAD_ON_STARTUP_DELAY); // Wait for the model to load
Expand Down
15 changes: 9 additions & 6 deletions baxter_sim_io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ project(baxter_sim_io)
# qt_build provides the qt cmake glue, roscpp the comms for a default talker
#find_package(catkin REQUIRED COMPONENTS qt_build roscpp baxter_core_msgs)
find_package(catkin REQUIRED COMPONENTS roscpp baxter_core_msgs)
find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui)
# find_package(Qt4 REQUIRED COMPONENTS QtCore QtGui)
find_package(Qt5 REQUIRED COMPONENTS Core Gui UiTools Widgets)
ADD_DEFINITIONS(-DQT_NO_KEYWORDS)
include_directories(${catkin_INCLUDE_DIRS})
# Use this to define what the package will export (e.g. libs, headers).
# Since the default here is to produce only a binary, we don't worry about
Expand All @@ -38,16 +40,17 @@ include_directories(include
##############################################################################
# Sections
##############################################################################
include(${QT_USE_FILE})
# MESSAGE(NOTICE ${QT5_USE_FILE})
# include(${QT_USE_FILE})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui)
file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc)
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/baxter_sim_io/*.hpp)

QT4_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
QT4_WRAP_UI(QT_FORMS_HPP ${QT_FORMS})
QT4_WRAP_CPP(QT_MOC_HPP ${QT_MOC})
QT5_ADD_RESOURCES(QT_RESOURCES_CPP ${QT_RESOURCES})
qt5_wrap_ui(QT_FORMS_HPP ${QT_FORMS})
qt5_wrap_cpp(QT_MOC_HPP ${QT_MOC})

##############################################################################
# Sources
Expand All @@ -60,7 +63,7 @@ file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINK
##############################################################################

add_executable(baxter_sim_io ${QT_SOURCES} ${QT_RESOURCES_CPP} ${QT_FORMS_HPP} ${QT_MOC_HPP})
target_link_libraries(baxter_sim_io ${QT_LIBRARIES} ${ROS_LIBRARIES} ${catkin_LIBRARIES})
target_link_libraries(baxter_sim_io ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${Qt5UiTools_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${ROS_LIBRARIES} ${catkin_LIBRARIES})

add_dependencies(baxter_sim_io baxter_core_msgs_gencpp)

Expand Down
3 changes: 2 additions & 1 deletion baxter_sim_io/include/baxter_sim_io/baxter_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
#ifndef BAXTER_SIM_IO_BAXTER_IO_H
#define BAXTER_SIM_IO_BAXTER_IO_H

#include <QtGui/QMainWindow>
// #include <QtGui/QMainWindow>
#include <QtWidgets/QMainWindow>
#include <QBitmap>
#include <QPushButton>
#include "ui_baxter_io.h"
Expand Down
7 changes: 5 additions & 2 deletions baxter_sim_io/include/baxter_sim_io/qnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@
#ifndef baxter_sim_io_QNODE_HPP_
#define baxter_sim_io_QNODE_HPP_

#ifndef Q_MOC_RUN
#include <ros/ros.h>
#include <baxter_core_msgs/NavigatorState.h>
#include <baxter_core_msgs/DigitalIOState.h>
#endif

#include <string>
#include <QThread>
#include <QStringListModel>
#include <baxter_core_msgs/NavigatorState.h>
#include <baxter_core_msgs/DigitalIOState.h>

namespace baxter_sim_io {

Expand Down
9 changes: 7 additions & 2 deletions baxter_sim_io/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
<buildtool_depend>catkin</buildtool_depend>
<!--build_depend>qt_build</build_depend-->
<build_depend>roscpp</build_depend>
<build_depend>libqt4-dev</build_depend>
<!-- <build_depend>libqt4-dev</build_depend> -->
<build_depend>baxter_core_msgs</build_depend>
<!--run_depend>qt_build</run_depend-->
<build_depend>qt_gui</build_depend>
<run_depend>libqt5-core</run_depend>
<run_depend>libqt5-gui</run_depend>
<run_depend>libqt5-widgets</run_depend>
<run_depend>qt_gui</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>libqt4-dev</run_depend>
<!-- <run_depend>libqt4-dev</run_depend> -->
<run_depend>baxter_core_msgs</run_depend>

</package>
2 changes: 1 addition & 1 deletion baxter_sim_kinematics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find_package(catkin
)

find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
find_package(Eigen3 REQUIRED)

catkin_package(
INCLUDE_DIRS include
Expand Down
8 changes: 8 additions & 0 deletions baxter_sim_kinematics/src/arm_kinematics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#include <cstring>
#include <ros/ros.h>
#include <baxter_sim_kinematics/arm_kinematics.h>
#if ROS_VERSION_MINIMUM(1, 14, 0) //Melodic
#include <memory>
#endif

namespace arm_kinematics {

Expand Down Expand Up @@ -245,8 +248,13 @@ bool Kinematics::loadModel(const std::string xml) {
*/
bool Kinematics::readJoints(urdf::Model &robot_model) {
num_joints = 0;
#if ROS_VERSION_MINIMUM(1, 14, 0) // Melodic
std::shared_ptr<const urdf::Link> link = robot_model.getLink(tip_name);
std::shared_ptr<const urdf::Joint> joint;
#else
boost::shared_ptr<const urdf::Link> link = robot_model.getLink(tip_name);
boost::shared_ptr<const urdf::Joint> joint;
#endif
for (int i = 0; i < chain.getNrOfSegments(); i++)
while (link && link->name != root_name) {
if (!(link->parent_joint)) {
Expand Down