marche je crois

This commit is contained in:
Camille CONJAT 2023-12-14 10:35:14 +01:00
parent dca11f8903
commit 399f1bd18c
9 changed files with 63 additions and 9 deletions

View File

View File

@ -0,0 +1,13 @@
# Catkin Tools Metadata
This directory was generated by catkin_tools and it contains persistent
configuration information used by the `catkin` command and its sub-commands.
Each subdirectory of the `profiles` directory contains a set of persistent
configuration options for separate profiles. The default profile is called
`default`. If another profile is desired, it can be described in the
`profiles.yaml` file in this directory.
Please see the catkin_tools documentation before editing any files in this
directory. Most actions can be performed with the `catkin` command-line
program.

View File

@ -0,0 +1 @@
0.9.0

View File

@ -0,0 +1,22 @@
authors: []
blacklist: []
build_space: build
catkin_make_args: []
cmake_args: []
devel_layout: linked
devel_space: devel
extend_path: null
extends: null
install: false
install_space: install
isolate_install: false
jobs_args: []
licenses:
- TODO
log_space: logs
maintainers: []
make_args: []
source_space: src
use_env_cache: false
use_internal_make_jobserver: true
whitelist: []

View File

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.0.2) cmake_minimum_required(VERSION 3.0.2)
project(poppy_ros) project(poppy_ros)
set (OpenCV_DIR "/usr/lib/opencv")
## Compile as C++11, supported in ROS Kinetic and newer ## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11) # add_compile_options(-std=c++11)
@ -9,8 +11,13 @@ project(poppy_ros)
## is used, also find other catkin packages ## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS find_package(catkin REQUIRED COMPONENTS
roscpp roscpp
rospy
std_msgs std_msgs
geometry_msgs
message_generation
)
find_package(OpenCV REQUIRED COMPONENTS
core
) )
## System dependencies are found with CMake's conventions ## System dependencies are found with CMake's conventions
@ -68,10 +75,7 @@ find_package(catkin REQUIRED COMPONENTS
# ) # )
## Generate added messages and services with any dependencies listed here ## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs
# )
################################################ ################################################
## Declare ROS dynamic reconfigure parameters ## ## Declare ROS dynamic reconfigure parameters ##
@ -116,7 +120,12 @@ catkin_package(
## Specify additional locations of header files ## Specify additional locations of header files
## Your package locations should be listed before other locations ## Your package locations should be listed before other locations
include_directories( include_directories(
# include /home/ros/SOFTWARE/toolkit-dynamixel
/home/ros/SOFTWARE/toolkit-dynamixel/include
/home/ros/SOFTWARE/toolkit-kinematics
/home/ros/SOFTWARE/toolkit-kinematics/include
${OpenCV_INCLUDE_DIRS}
/home/ros/SOFTWARE/eigen/Eigen
${catkin_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
) )
@ -134,6 +143,7 @@ include_directories(
## With catkin_make all packages are built within a single CMake context ## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide ## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/poppy_ros_node.cpp) # add_executable(${PROJECT_NAME}_node src/poppy_ros_node.cpp)
add_executable(poppy_ros src/poppy_ros.cpp /home/ros/SOFTWARE/toolkit-dynamixel/src/DynamixelHandler.cpp)
## Rename C++ executable without prefix ## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the ## The above recommended prefix causes long target names, the following renames the
@ -149,6 +159,7 @@ include_directories(
# target_link_libraries(${PROJECT_NAME}_node # target_link_libraries(${PROJECT_NAME}_node
# ${catkin_LIBRARIES} # ${catkin_LIBRARIES}
# ) # )
target_link_libraries(poppy_ros dxl_x64_cpp rt ${catkin_LIBRARIES})
############# #############
## Install ## ## Install ##

View File

@ -0,0 +1 @@
catkin build

View File

@ -0,0 +1,6 @@
devel_space: /home/ros/catkin_ws/src/poppy_ros/devel
install: false
install_space: /home/ros/catkin_ws/src/poppy_ros/install
profile: default
source_space: /home/ros/catkin_ws/src/poppy_ros/src
workspace: /home/ros/catkin_ws/src/poppy_ros

View File

@ -0,0 +1 @@
catkin build

View File

@ -1,6 +1,5 @@
#include "ros/ros.h" #include "ros/ros.h"
#include "geometry_msgs/Twist.h" #include "geometry_msgs/Twist.h"
#include "std_msgs/Float64MultiArray.msg"
#include "DynamixelHandler.h" #include "DynamixelHandler.h"
// Global variables // Global variables
@ -30,7 +29,7 @@ void jointCMDCallback(const geometry_msgs::Twist& joint_cmd)
jointVec.push_back(joint_cmd.angular.y); jointVec.push_back(joint_cmd.angular.y);
jointVec.push_back(joint_cmd.angular.z); jointVec.push_back(joint_cmd.angular.z);
//call sendTargetJOintPosition(vector) of DxlHandler //call sendTargetJOintPosition(vector) of DxlHandler
_oDxlHandler.sendtargetJointPosition(jointVec); _oDxlHandler.sendTargetJointPosition(jointVec);
} }
int convertAnglesToJointCmd(float fJointAngle) int convertAnglesToJointCmd(float fJointAngle)
@ -56,7 +55,7 @@ int main(int argc, char** argv)
_jointPositionPublisher = nh.advertise<geometry_msgs::Twist>("joint_position", 1); _jointPositionPublisher = nh.advertise<geometry_msgs::Twist>("joint_position", 1);
//create a subscriber //create a subscriber
ros::Subscriber sub = nh.suscribe("joint_cmd",1, jointCMDCallback); ros::Subscriber sub = nh.subscribe("joint_cmd",1, jointCMDCallback);
// create a loop rate // create a loop rate
ros::Rate loopRate(_fps); ros::Rate loopRate(_fps);