Compare commits

...

14 Commits

Author SHA1 Message Date
02fce8a892 I nodi non sono segnati come Required
Spegnimento grafecul attraverso interfaccia
2019-11-19 09:21:38 +01:00
ba5ed10349 Modifica angoli RPY per tenere utensile perpendicolare al terreno 2019-11-19 09:20:45 +01:00
dde6d1e083 Recorder continua a crashare a caso quando si apre file con plot 2019-11-15 17:01:45 +01:00
73ab44a67e Aggiunti messaggi di debug ai nodi
Crash di Recorder quando si cerca di plottare un percorso, il problema
sta negli strumenti rViz, debug necessario
2019-11-15 16:45:29 +01:00
aef477e8e5 Crash alla partenza del nodo brodcaster 2019-11-15 14:46:16 +01:00
16eed0ad4e Inizializzazione broadcaster con operazioni standard dei nodi 2019-11-15 12:22:50 +01:00
a3f75e5449 Ricompilazione con nuovo nodo TF broadcaster 2019-11-14 17:08:39 +01:00
c9108aaa54 Filet temporaei eliminati prima della ricompilazione 2019-11-14 16:10:59 +01:00
e3b88fe742 Aggiunto nodo Broadcaster continuo delle trasformazioni 2019-11-14 16:10:36 +01:00
d725017879 Plot del percorso con reference frame corrente e non world 2019-11-14 15:46:18 +01:00
270bf14a3e Prima implementazione funzionante del cambio frame di riferimento 2019-11-13 15:55:23 +01:00
b98948ce17 aggiornato launch con rviz 2019-11-12 11:36:54 +01:00
b03c2e73bc aggiunto parametro planning frame di default 2019-11-12 10:51:35 +01:00
b7f1857e5c Inizia implementazione Set Frame 2019-11-12 10:51:15 +01:00
12 changed files with 345 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.9.1, 2019-11-05T16:47:35. --> <!-- Written by QtCreator 4.9.2, 2019-11-15T17:00:10. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@@ -72,7 +72,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b917fd33-cfca-4cf9-a8d9-025510846768}</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{b917fd33-cfca-4cf9-a8d9-025510846768}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">2</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
@@ -124,7 +124,7 @@
<value type="QString">ROS_PACKAGE_PATH=/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src:/opt/ros/kinetic/share</value> <value type="QString">ROS_PACKAGE_PATH=/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src:/opt/ros/kinetic/share</value>
<value type="QString">ROS_ROOT=/opt/ros/kinetic/share/ros</value> <value type="QString">ROS_ROOT=/opt/ros/kinetic/share/ros</value>
<value type="QString">ROS_VERSION=1</value> <value type="QString">ROS_VERSION=1</value>
<value type="QString">SHLVL=666</value> <value type="QString">SHLVL=940</value>
<value type="QString">TERM=xterm</value> <value type="QString">TERM=xterm</value>
<value type="QString">_=/usr/bin/env</value> <value type="QString">_=/usr/bin/env</value>
</valuelist> </valuelist>
@@ -483,7 +483,20 @@
<value type="QString" key="ROSProjectManager.ROSGenericStep.Target">roboglue_ros_urdriver.launch</value> <value type="QString" key="ROSProjectManager.ROSGenericStep.Target">roboglue_ros_urdriver.launch</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/launch/roboglue_ros_urdriver.launch</value> <value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/launch/roboglue_ros_urdriver.launch</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.RunStepList.StepsCount">1</value> <valuemap type="QVariantMap" key="ProjectExplorer.RunStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSAttachToNode</value>
<value type="bool" key="ProjectExplorer.RunStep.Enabled">true</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Arguments"></value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Command">debug</value>
<value type="bool" key="ROSProjectManager.ROSGenericStep.DebugContinueOnAttach">false</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Package">roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.PackagePath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Target">roboglue_ros_recorder</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/devel/lib/roboglue_ros/roboglue_ros_recorder</value>
</valuemap>
<value type="int" key="ProjectExplorer.RunStepList.StepsCount">2</value>
</valuemap> </valuemap>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>

View File

@@ -13,6 +13,7 @@ find_package(catkin REQUIRED COMPONENTS
moveit_ros_planning moveit_ros_planning
moveit_ros_planning_interface moveit_ros_planning_interface
moveit_visual_tools moveit_visual_tools
tf
) )
find_package (Eigen3 REQUIRED) find_package (Eigen3 REQUIRED)
@@ -148,6 +149,11 @@ include_directories(
src/roboglue_follower.cpp src/roboglue_follower.cpp
src/roboglue_utils.cpp src/roboglue_utils.cpp
) )
add_executable(
${PROJECT_NAME}_broadcaster
src/roboglue_broadcaster.cpp
src/roboglue_utils.cpp
)
add_executable ( add_executable (
${PROJECT_NAME}_test ${PROJECT_NAME}_test
src/roboglue_test.cpp src/roboglue_test.cpp
@@ -177,6 +183,9 @@ target_link_libraries(
target_link_libraries( target_link_libraries(
${PROJECT_NAME}_follower ${catkin_LIBRARIES} ${PROJECT_NAME}_follower ${catkin_LIBRARIES}
) )
target_link_libraries(
${PROJECT_NAME}_broadcaster ${catkin_LIBRARIES}
)
############# #############

View File

@@ -0,0 +1,51 @@
N,X,Y,Z,rR,rP,rY,DT,DS
N0,0.018000,0.306000,0.500000,0.000000,1.571000,1.571000,0.000000,0.000000
N1,0.018000,0.312000,0.500000,0.000000,1.571000,1.571000,0.095493,0.006000
N2,0.018000,0.318000,0.500000,0.000000,1.571000,1.571000,0.177313,0.006000
N3,0.018000,0.324000,0.500000,0.000000,1.571000,1.571000,0.276251,0.006000
N4,-0.006000,0.324000,0.500000,0.000000,1.571000,1.571000,0.376993,0.024000
N5,-0.024000,0.312000,0.500000,0.000000,1.571000,1.571000,0.477276,0.021633
N6,-0.030000,0.288000,0.500000,0.000000,1.571000,1.571000,0.583836,0.024739
N7,-0.048000,0.258000,0.500000,0.000000,1.571000,1.571000,0.674398,0.034986
N8,-0.060000,0.246000,0.500000,0.000000,1.571000,1.571000,0.779036,0.016971
N9,-0.066000,0.240000,0.500000,0.000000,1.571000,1.571000,0.878682,0.008485
N10,-0.078000,0.240000,0.500000,0.000000,1.571000,1.571000,0.985584,0.012000
N11,-0.126000,0.240000,0.500000,0.000000,1.571000,1.571000,1.076938,0.048000
N12,-0.150000,0.240000,0.500000,0.000000,1.571000,1.571000,1.173122,0.024000
N13,-0.162000,0.252000,0.500000,0.000000,1.571000,1.571000,1.278250,0.016971
N14,-0.174000,0.258000,0.500000,0.000000,1.571000,1.571000,1.378685,0.013416
N15,-0.186000,0.276000,0.500000,0.000000,1.571000,1.571000,1.484213,0.021633
N16,-0.198000,0.300000,0.500000,0.000000,1.571000,1.571000,0.006499,0.026833
N17,-0.204000,0.324000,0.500000,0.000000,1.571000,1.571000,1.690293,0.024739
N18,-0.204000,0.342000,0.500000,0.000000,1.571000,1.571000,1.780065,0.018000
N19,-0.204000,0.378000,0.500000,0.000000,1.571000,1.571000,1.872321,0.036000
N20,-0.222000,0.450000,0.500000,0.000000,1.571000,1.571000,1.977848,0.074216
N21,-0.318000,0.468000,0.500000,0.000000,1.571000,1.571000,2.070969,0.097673
N22,-0.396000,0.450000,0.500000,0.000000,1.571000,1.571000,2.177687,0.080050
N23,-0.462000,0.348000,0.500000,0.000000,1.571000,1.571000,2.283137,0.121491
N24,-0.558000,0.264000,0.500000,0.000000,1.571000,1.571000,2.392030,0.127562
N25,-0.636000,0.246000,0.500000,0.000000,1.571000,1.571000,2.479188,0.080050
N26,-0.702000,0.306000,0.500000,0.000000,1.571000,1.571000,2.581360,0.089196
N27,-0.702000,0.402000,0.500000,0.000000,1.571000,1.571000,2.672705,0.096000
N28,-0.618000,0.480000,0.500000,0.000000,1.571000,1.571000,2.780175,0.114630
N29,-0.540000,0.468000,0.500000,0.000000,1.571000,1.571000,2.887023,0.078918
N30,-0.300000,0.384000,0.500000,0.000000,1.571000,1.571000,2.980252,0.254275
N31,-0.126000,0.336000,0.500000,0.000000,1.571000,1.571000,3.088443,0.180499
N32,-0.012000,0.318000,0.500000,0.000000,1.571000,1.571000,3.172616,0.115412
N33,0.042000,0.372000,0.500000,0.000000,1.571000,1.571000,3.277146,0.076368
N34,0.042000,0.396000,0.500000,0.000000,1.571000,1.571000,3.385895,0.024000
N35,0.024000,0.390000,0.500000,0.000000,1.571000,1.571000,3.478245,0.018974
N36,0.000000,0.288000,0.500000,0.000000,1.571000,1.571000,3.585851,0.104785
N37,0.048000,0.234000,0.500000,0.000000,1.571000,1.571000,3.673290,0.072250
N38,0.198000,0.252000,0.500000,0.000000,1.571000,1.571000,3.786958,0.151076
N39,0.252000,0.306000,0.500000,0.000000,1.571000,1.571000,3.881606,0.076368
N40,0.264000,0.336000,0.500000,0.000000,1.571000,1.571000,3.977590,0.032311
N41,0.330000,0.234000,0.500000,0.000000,1.571000,1.571000,4.082062,0.121491
N42,0.330000,0.162000,0.500000,0.000000,1.571000,1.571000,4.177567,0.072000
N43,0.336000,0.102000,0.500000,0.000000,1.571000,1.571000,4.284022,0.060299
N44,0.396000,0.096000,0.500000,0.000000,1.571000,1.571000,4.377034,0.060299
N45,0.450000,0.144000,0.500000,0.000000,1.571000,1.571000,4.494896,0.072250
N46,0.456000,0.252000,0.500000,0.000000,1.571000,1.571000,4.604838,0.108167
N47,0.420000,0.300000,0.500000,0.000000,1.571000,1.571000,4.684846,0.060000
N48,0.378000,0.324000,0.500000,0.000000,1.571000,1.571000,4.774341,0.048374
N49,0.348000,0.324000,0.500000,0.000000,1.571000,1.571000,4.876254,0.030000

View File

@@ -0,0 +1 @@
{"code":"{613d5288-5d28-465d-996d-db6750a6789c}","ds":0.5,"dt":0.5,"frame_base":"---","frame_work":{"name":"---","offset":{"r":0.0,"x":0.0,"y":0.0,"z":0.0}},"n_analog":0,"n_digital":0,"n_point":50,"name":"test99","type":"time/dist"}

View File

@@ -54,6 +54,7 @@ typedef struct {
int loopRate, msgBufferSize; int loopRate, msgBufferSize;
std::string param_ns; std::string param_ns;
std_msgs::String startupMsg, shutdownMsg; std_msgs::String startupMsg, shutdownMsg;
std::string defaultFrameName;
} COMMON_parameters; } COMMON_parameters;
///////// AUX DATA STORAGE /////////////// ///////// AUX DATA STORAGE ///////////////
@@ -77,12 +78,15 @@ typedef struct{
bool isRecording = false; bool isRecording = false;
bool isRealtime = false; bool isRealtime = false;
bool isRunning = true; bool isRunning = true;
bool setFrame = false;
} internalState; } internalState;
////////// POSITION DATA STORAGE /////////// ////////// POSITION DATA STORAGE ///////////
typedef struct { typedef struct {
geometry_msgs::TwistStamped twist; geometry_msgs::TwistStamped twist;
trajectory_msgs::JointTrajectory joint; trajectory_msgs::JointTrajectory joint;
geometry_msgs::Pose activeFrame;
std::string activeFrameName;
bool waitIK = false; bool waitIK = false;
bool isFirst = false; bool isFirst = false;
bool isNew = false; bool isNew = false;

View File

@@ -1,6 +1,6 @@
<launch> <launch>
<!-- Set logger format --> <!-- Set logger format -->
<env name="ROSCONSOLE_FORMAT" value="[${severity}] [${node}]: ${message}" /> <env name="ROSCONSOLE_FORMAT" value="[${severity}] [${node}][${line}]: ${message}" />
<!-- <env name="ROSCONSOLE_FORMAT" value="[${severity}] [${node}] [${function}]: ${message}" />--> <!-- <env name="ROSCONSOLE_FORMAT" value="[${severity}] [${node}] [${function}]: ${message}" />-->
<!-- Start ROS official URobotics controller --> <!-- Start ROS official URobotics controller -->
@@ -13,55 +13,66 @@
<!-- <arg name="robot_ip" value="10.0.0.5" /> --> <!-- <arg name="robot_ip" value="10.0.0.5" /> -->
</include> </include>
<!-- Start rViz API interface-->
<include file="$(find ur10_e_moveit_config)/launch/moveit_rviz.launch">
<arg name="config" value="true" />
</include>
<!-- Common parameter Server --> <!-- Common parameter Server -->
<group ns="roboglue_ros_common"> <group ns="roboglue_ros_common">
<!-- ROS internal topics -->
<param name="INstate" type="string" value="/roboglue_com/com2ros/state" /> <param name="INstate" type="string" value="/roboglue_com/com2ros/state" />
<param name="INcommands" type="string" value="/roboglue_com/com2ros/commands" /> <param name="INcommands" type="string" value="/roboglue_com/com2ros/commands" />
<param name="INcoordinates" type="string" value="/roboglue_com/com2ros/coordinates" /> <param name="INcoordinates" type="string" value="/roboglue_com/com2ros/coordinates" />
<param name="INinterface" type="string" value="/roboglue_com/com2ros/interface" />
<param name="OUTstate" type="string" value="/roboglue_com/ros2com/state" /> <param name="OUTstate" type="string" value="/roboglue_com/ros2com/state" />
<param name="OUTcommands" type="string" value="/roboglue_com/ros2com/commands" /> <param name="OUTcommands" type="string" value="/roboglue_com/ros2com/commands" />
<param name="OUTcoordinates" type="string" value="/roboglue_com/ros2com/coordinates" /> <param name="OUTcoordinates" type="string" value="/roboglue_com/ros2com/coordinates" />
<param name="OUTinterface" type="string" value="/roboglue_com/ros2com/interface" />
<!-- ROS movement topics (For UR official driver use scalable position controller) -->
<param name="OUTdelta_jog" type="string" value="/jog_arm_server/delta_jog_cmds" /> <param name="OUTdelta_jog" type="string" value="/jog_arm_server/delta_jog_cmds" />
<param name="OUTdelta_joint_jog" type="string" value="/jog_arm_server/delta_joint_jog_cmds" /> <param name="OUTdelta_joint_jog" type="string" value="/jog_arm_server/delta_joint_jog_cmds" />
<param name="OUTtraj_jog" type="string" value="/pos_based_pos_traj_controller/command" /> <param name="OUTtraj_jog" type="string" value="/scaled_pos_traj_controller/command" />
<!-- ROS robot model description and defaults -->
<param name="robot_model_name" type="string" value="robot_description" /> <param name="robot_model_name" type="string" value="robot_description" />
<param name="move_group_name" type="string" value="manipulator" /> <param name="move_group_name" type="string" value="manipulator" />
<param name="min_nonzero_move" type="double" value="0.005" />
<param name="joint_jump_tresh" type="double" value="45.0" />
<param name="default_frame_name" type="string" value= "/world"/>
<rosparam command="load" file="$(find roboglue_ros)/config/jointDefaults.yaml" />
<!-- ROS node loop parameters -->
<param name="startup_msg" type="string" value="STARTUP"/>
<param name="shutdown_msg" type="string" value="SHUTDOWN"/>
<param name="heartbeat_msg" type="string" value="HB"/>
<param name="loop_rate" type="int" value="100" /> <param name="loop_rate" type="int" value="100" />
<param name="msg_buffer" type="int" value="100" /> <param name="msg_buffer" type="int" value="100" />
<param name="joint_jump_tresh" type="double" value="45.0" />
<param name="min_nonzero_move" type="double" value="0.005" />
</group> </group>
<!-- Message Relay to/from MQTT --> <!-- Message Relay to/from MQTT -->
<node name="roboglue_ros_relay" pkg="roboglue_ros" type="roboglue_ros_relay" output="screen" required="true"> <node name="roboglue_ros_relay" pkg="roboglue_ros" type="roboglue_ros_relay" output="screen" required="true">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" /> <param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"RELAY"}'/>
<param name="mqtt_host" type="string" value="tcp://localhost:1883" /> <param name="mqtt_host" type="string" value="tcp://localhost:1883" />
<param name="mqtt_qos" type="int" value="0" /> <param name="mqtt_qos" type="int" value="0" />
<param name="mqtt_INstate" type="string" value="roboglue_com/com2ros/state" /> <param name="mqtt_INstate" type="string" value="roboglue_com/com2ros/state" />
<param name="mqtt_INcommands" type="string" value="roboglue_com/com2ros/commands" /> <param name="mqtt_INcommands" type="string" value="roboglue_com/com2ros/commands" />
<param name="mqtt_INcoordinates" type="string" value="roboglue_com/com2ros/coordinates" /> <param name="mqtt_INcoordinates" type="string" value="roboglue_com/com2ros/coordinates" />
<param name="mqtt_INinterface" type="string" value="roboglue_com/com2ros/interface" />
<param name="mqtt_OUTstate" type="string" value="roboglue_com/ros2com/state" /> <param name="mqtt_OUTstate" type="string" value="roboglue_com/ros2com/state" />
<param name="mqtt_OUTcommands" type="string" value="roboglue_com/ros2com/commands" /> <param name="mqtt_OUTcommands" type="string" value="roboglue_com/ros2com/commands" />
<param name="mqtt_OUTcoordinates" type="string" value="roboglue_com/ros2com/coordinates" /> <param name="mqtt_OUTcoordinates" type="string" value="roboglue_com/ros2com/coordinates" />
<param name="mqtt_OUTinterface" type="string" value="roboglue_com/ros2com/interface" />
</node>
<!-- Frame Transform Broadcaster -->
<node name="roboglue_ros_broadcaster" pkg="roboglue_ros" type="roboglue_ros_broadcaster" output="screen" required="false">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="tf_pub_rate" type="int" value="10" />
</node> </node>
<!-- Real Time Tracking --> <!-- Real Time Tracking -->
<node name="roboglue_ros_follower" pkg="roboglue_ros" type="roboglue_ros_follower" output="screen" required="true"> <node name="roboglue_ros_follower" pkg="roboglue_ros" type="roboglue_ros_follower" output="screen" required="false">
<param name="parameter_ns" type="string" value="roboglue_ros_common" /> <param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"FOLLOWER"}'/>
<param name="jog_pub_rate" type="int" value="5" /> <param name="jog_pub_rate" type="int" value="5" />
</node> </node>
<!-- Tracking data Recorder/Player --> <!-- Tracking data Recorder/Player -->
<node name="roboglue_ros_recorder" pkg="roboglue_ros" type="roboglue_ros_recorder" output="screen" required="true"> <node name="roboglue_ros_recorder" pkg="roboglue_ros" type="roboglue_ros_recorder" output="screen" required="false">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" /> <param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"RECORDER"}'/>
<param name="point_group_mode" type="string" value="dist" /> <param name="point_group_mode" type="string" value="dist" />
<param name="planning_mode" type="string" value="path" /> <param name="planning_mode" type="string" value="path" />
<param name="meta_dir" type="string" value="/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/config/meta/" /> <param name="meta_dir" type="string" value="/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/config/meta/" />
@@ -72,4 +83,9 @@
<param name="data_template" type="string" value="@data_template.data" /> <param name="data_template" type="string" value="@data_template.data" />
</node> </node>
<!-- Start rViz API interface-->
<include file="$(find ur10_e_moveit_config)/launch/moveit_rviz.launch">
<arg name="config" value="true" />
</include>
</launch> </launch>

View File

@@ -33,6 +33,7 @@
<param name="move_group_name" type="string" value="manipulator" /> <param name="move_group_name" type="string" value="manipulator" />
<param name="min_nonzero_move" type="double" value="0.005" /> <param name="min_nonzero_move" type="double" value="0.005" />
<param name="joint_jump_tresh" type="double" value="45.0" /> <param name="joint_jump_tresh" type="double" value="45.0" />
<param name="default_frame_name" type="string" value= "/world"/>
<rosparam command="load" file="$(find roboglue_ros)/config/jointDefaults.yaml" /> <rosparam command="load" file="$(find roboglue_ros)/config/jointDefaults.yaml" />
<!-- ROS node loop parameters --> <!-- ROS node loop parameters -->
<param name="startup_msg" type="string" value="STARTUP"/> <param name="startup_msg" type="string" value="STARTUP"/>

View File

@@ -0,0 +1,176 @@
/*
20191115 - Inizia la scrittura del nodo che si occupa di pubblicate le trasformazioni TF, documentazione su GIT
*/
////////// ROS INCLUDES /////////////
#include "ros/ros.h"
#include <roboglue_ros/roboglue_utils.h> /// utility function library
#include <moveit/move_group_interface/move_group_interface.h>
#include <tf/transform_broadcaster.h>
///////////////////////////////////////////
///////// ROS CALLBACKS //////////////////
/////////////////////////////////////////
void commandCallback(const std_msgs::String::ConstPtr& msg, internalState* is, publisherMap* pubs, positionData* pos, robotData* rdata) {
ROS_DEBUG("Received command: [%s]", msg->data.c_str());
try {
nlohmann::json c = nlohmann::json::parse(msg->data.c_str());
std::string command = c["command"];
nlohmann::json params = c["params"];
std::string action;
if (!command.compare("QUIT")){
is->isRunning = false;
} else if (!command.compare("SETFRAME")){
action = params["action"];
if (!action.compare("reset")){
pos->activeFrameName="world";
pos->activeFrame=geometry_msgs::Pose();
} else if (!action.compare("set")){
pos->activeFrameName = params["framename"];
geometry_msgs::TwistStamped tempFrame;
tempFrame.twist.linear.x = params["frame"]["x"].get<double>()/1000.0;
tempFrame.twist.linear.y = params["frame"]["y"].get<double>()/1000.0;
tempFrame.twist.linear.z = params["frame"]["z"].get<double>()/1000.0;
tempFrame.twist.angular.x = deg2rad(params["frame"]["rx"].get<double>());
tempFrame.twist.angular.y = deg2rad(params["frame"]["ry"].get<double>());
tempFrame.twist.angular.z = deg2rad(params["frame"]["rz"].get<double>());
pos->activeFrame = twist2Pose(tempFrame).pose;
} else;
} else {
ROS_WARN("Unknown command: %s", command.c_str());
}
} catch (nlohmann::json::exception &e){
ROS_ERROR("Failed to parse COMMAND: [%s]", e.what());
}
}
void stateCallback(const std_msgs::String::ConstPtr& msg, internalState* is, auxData* aux){
ROS_DEBUG("Received aux I/O State Update: [%s]", msg->data.c_str());
}
void interfaceCallback(const std_msgs::String::ConstPtr& msg, internalState *is){
ROS_DEBUG("Received Interface Message: [%s]", msg->data.c_str());
}
void heartBeatCallback(const ros::TimerEvent& t, publisherMap* p){
try {
std_msgs::String hbMsg;
hbMsg.data = std::string("HB:"+
boost::replace_all_copy(ros::this_node::getName(), "/", "")+
":" + std::to_string(t.current_real.toSec()));
p->find("/roboglue_com/ros2com/interface")->second->publish(hbMsg);
} catch (std::exception &e) {
ROS_ERROR("Impossible to Send HeartBeat -> %s", e.what());
}
}
////////////////////////////////////////
//////////////// MAIN //////////////////
////////////////////////////////////////
int main(int argc, char **argv) {
/// node variables ///
COMMON_parameters common_par;
/// internal state struct ////
internalState is;
positionData pos_data;
robotData robot_data;
auxData aux_data;
rvizData rviz_data;
int tfPubRate;
/// declare publisher map ///
publisherMap publishers;
/// setup node parameters ///
ros::init(argc, argv, "roboglue_broadcaster");
ros::NodeHandle nh;
/// set console log level ///
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug);
///read parameters from server ///
nh.getParam("/roboglue_ros_broadcaster/parameter_ns", common_par.param_ns);
ROS_DEBUG("Using Parameter Nameserver [%s]", common_par.param_ns.c_str());
loadCommonParameters(&nh, &common_par);
// load robot model information
nh.getParam(common_par.param_ns+"robot_model_name", robot_data.robot_model_name);
nh.getParam(common_par.param_ns+"move_group_name", robot_data.move_group_name);
// load default frame parameters
nh.getParam(common_par.param_ns+"default_frame_name", pos_data.activeFrameName);
// load jog coord publish rate
nh.getParam("/roboglue_ros_broadcaster/tf_pub_rate", tfPubRate);
/// set spinner rate ///
ros::Rate loop_rate(common_par.loopRate);
ROS_INFO("Broadcaster Node Started");
ROS_DEBUG("Robot Model [%s] Loaded.. ", robot_data.robot_model_name.c_str());
ROS_DEBUG("Move Group [%s] Loaded.. ", robot_data.move_group_name.c_str());
/// subscribe to incoming topics ///
ros::Subscriber command_sub = nh.subscribe<std_msgs::String>(common_par.ros_topics.commandSub, static_cast<uint32_t>(common_par.msgBufferSize),
boost::bind(commandCallback, _1, &is, &publishers, &pos_data, &robot_data));
ros::Subscriber state_sub = nh.subscribe<std_msgs::String>(common_par.ros_topics.stateSub, static_cast<uint32_t>(common_par.msgBufferSize),
boost::bind(stateCallback, _1, &is, &aux_data));
/// advertise publish topics //
ros::Publisher command_pub = nh.advertise<std_msgs::String>(common_par.ros_topics.commandPub,
static_cast<uint32_t>(common_par.msgBufferSize));
ros::Publisher interface_pub = nh.advertise<std_msgs::String>(common_par.ros_topics.interfacePub,
static_cast<uint32_t>(common_par.msgBufferSize));
/// build a list of publisher to pass to mqtt callback ///
publishers[command_pub.getTopic()] = &command_pub;
publishers[interface_pub.getTopic()] = &interface_pub;
/// load the robot model for inverse kinematics and self collision checking ///
/// requires parameter server and moveIT to be active
moveit::planning_interface::MoveGroupInterface move_group(robot_data.move_group_name);
robot_data.kine_model = move_group.getRobotModel();
robot_data.kine_state = std::make_shared<robot_state::RobotState>(robot_data.kine_model);
robot_data.joint_modelGroup = robot_data.kine_state->getJointModelGroup(robot_data.move_group_name);
robot_data.joint_names = robot_data.joint_modelGroup->getVariableNames();
ROS_INFO("Planning in Frame: %s for link: %s", move_group.getPlanningFrame().c_str(), move_group.getEndEffectorLink().c_str());
ROS_INFO("IK calc in Frame: %s", robot_data.kine_model->getModelFrame().c_str());
/// create timed callbacks ///
ros::Timer heartBeat = nh.createTimer(ros::Duration(5.0),
boost::bind(heartBeatCallback, _1, &publishers));
/// variables for TF publication
tf::TransformBroadcaster tfBroadcaster;
tf::Transform planningFrame;
tf::Quaternion frameRot;
/// setup rviz palnned path visualization
rviz_data.vtools = std::make_shared<mvt::MoveItVisualTools>("world", "rviz_visual_tools", robot_data.kine_model);
///////////////////// MAIN LOOP //////////////////////
bool startCycle = true;
while (ros::ok() && is.isRunning) {
if (startCycle){
startCycle = false;
declareStartup(&publishers, &common_par);
ros::spinOnce();
}
ROS_DEBUG_ONCE("Broadcaster Node Looping");
ros::spinOnce();
/// publish planning frame transform ///
/// verify execution frame and set to default if needed
ROS_DEBUG_ONCE("Planning Frame changed and publishing!");
planningFrame.setOrigin(tf::Vector3(pos_data.activeFrame.position.x,pos_data.activeFrame.position.y,pos_data.activeFrame.position.z));
frameRot.setRPY(pos_data.activeFrame.orientation.x,pos_data.activeFrame.orientation.y,pos_data.activeFrame.orientation.z);
planningFrame.setRotation(frameRot);
tfBroadcaster.sendTransform(tf::StampedTransform(planningFrame, ros::Time::now(), "world", "planning_frame"));
rviz_data.vtools->setBaseFrame("planning_frame");
move_group.setPoseReferenceFrame("planning_frame");
/// shutdown operations
if(ros::isShuttingDown()){
declareShutdown(&publishers, &common_par);
ros::spinOnce();
}
loop_rate.sleep();
}
ros::shutdown();
//////////////////////////////////////////////////////
return 0;
}
////////////////////////////////////////
///////////// END MAIN /////////////////
////////////////////////////////////////

View File

@@ -204,16 +204,19 @@ int main(int argc, char **argv) {
auxData aux_data; auxData aux_data;
std::vector<std::string> joint_names; std::vector<std::string> joint_names;
int jogPubRate; int jogPubRate;
/// declare publisher map ////
publisherMap publishers;
/// setup node parameters /// /// setup node parameters ///
ros::init(argc, argv, "roboglue_follower"); ros::init(argc, argv, "roboglue_follower");
//TODO: ros::init(argc, argv, "roboglue_follower", ros::init_options::NoSigintHandler); //TODO: ros::init(argc, argv, "roboglue_follower", ros::init_options::NoSigintHandler);
ros::NodeHandle nh; ros::NodeHandle nh;
publisherMap publishers; /// set console log level ///
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug);
/// TODO: override default signal handler /// /// TODO: override default signal handler ///
// signal(SIGINT, boost::bind(sigintHandler, _1, &is)); // signal(SIGINT, boost::bind(sigintHandler, _1, &is));
///read parameters from server /// ///read parameters from server ///
nh.getParam("/roboglue_ros_recorder/parameter_ns", common_par.param_ns); nh.getParam("/roboglue_ros_recorder/parameter_ns", common_par.param_ns);
ROS_DEBUG("Using Parameter Nameserver [%s]", common_par.param_ns.c_str());
loadCommonParameters(&nh, &common_par); loadCommonParameters(&nh, &common_par);
// load robot model information // load robot model information
nh.getParam(common_par.param_ns+"robot_model_name", robot_data.robot_model_name); nh.getParam(common_par.param_ns+"robot_model_name", robot_data.robot_model_name);
@@ -225,9 +228,10 @@ int main(int argc, char **argv) {
/// set spinner rate /// /// set spinner rate ///
ros::Rate loop_rate(common_par.loopRate); ros::Rate loop_rate(common_par.loopRate);
/// set console log level ///
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug);
ROS_INFO("Follower Node Started"); ROS_INFO("Follower Node Started");
ROS_DEBUG("Robot Model [%s] Loaded.. ", robot_data.robot_model_name.c_str());
ROS_DEBUG("Move Group [%s] Loaded.. ", robot_data.move_group_name.c_str());
/// subscribe to incoming topics /// /// subscribe to incoming topics ///
ros::Subscriber command_sub = nh.subscribe<std_msgs::String>(common_par.ros_topics.commandSub, static_cast<uint32_t>(common_par.msgBufferSize), ros::Subscriber command_sub = nh.subscribe<std_msgs::String>(common_par.ros_topics.commandSub, static_cast<uint32_t>(common_par.msgBufferSize),

View File

@@ -39,6 +39,7 @@
#include "ros/ros.h" #include "ros/ros.h"
#include <roboglue_ros/roboglue_utils.h> /// utility function library #include <roboglue_ros/roboglue_utils.h> /// utility function library
#include <moveit/move_group_interface/move_group_interface.h> #include <moveit/move_group_interface/move_group_interface.h>
#include <tf/transform_broadcaster.h>
///////// STANDARD LIBRARIES //////// ///////// STANDARD LIBRARIES ////////
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
@@ -108,6 +109,13 @@ void commandCallback(const std_msgs::String::ConstPtr& msg, internalState* is, p
is->isPlaying = false; is->isPlaying = false;
is->isRecording = false; is->isRecording = false;
} }
} else if (!command.compare("SETFRAME")) {
action = params["action"];
if (!action.compare("reset")){
is->setFrame = true;
} else if (!action.compare("set")){
is->setFrame = true;
}
} else { } else {
ROS_WARN("Unknown command: %s", command.c_str()); ROS_WARN("Unknown command: %s", command.c_str());
} }
@@ -227,6 +235,8 @@ int main(int argc, char **argv) {
file_data.recordVect = &recordVector; file_data.recordVect = &recordVector;
file_data.playVect = &playVector; file_data.playVect = &playVector;
double nonzero_move; double nonzero_move;
/// declare publisher map ///
publisherMap publishers;
/// player variables /// /// player variables ///
double dsCounter, dtCounter; double dsCounter, dtCounter;
@@ -237,10 +247,13 @@ int main(int argc, char **argv) {
/// setup node parameters /// /// setup node parameters ///
ros::init(argc, argv, "roboglue_recorder"); ros::init(argc, argv, "roboglue_recorder");
ros::NodeHandle nh; ros::NodeHandle nh;
publisherMap publishers; /// set console log level ///
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug);
/// read parameters from server /// /// read parameters from server ///
//load common parameters //load common parameters
nh.getParam("/roboglue_ros_recorder/parameter_ns", common_par.param_ns); nh.getParam("/roboglue_ros_recorder/parameter_ns", common_par.param_ns);
ROS_DEBUG("Using Parameter Nameserver [%s]", common_par.param_ns.c_str());
loadCommonParameters(&nh, &common_par); loadCommonParameters(&nh, &common_par);
// TODO: inserire anche questi parametri tra quelli comuni // TODO: inserire anche questi parametri tra quelli comuni
// load robot model information // load robot model information
@@ -248,6 +261,8 @@ int main(int argc, char **argv) {
nh.getParam(common_par.param_ns+"robot_model_name", robot_data.robot_model_name); nh.getParam(common_par.param_ns+"robot_model_name", robot_data.robot_model_name);
nh.getParam(common_par.param_ns+"move_group_name", robot_data.move_group_name); nh.getParam(common_par.param_ns+"move_group_name", robot_data.move_group_name);
nh.getParam(common_par.param_ns+"joint_jump_tresh", robot_data.joint_jump_tresh); nh.getParam(common_par.param_ns+"joint_jump_tresh", robot_data.joint_jump_tresh);
// load default frame parameters
nh.getParam(common_par.param_ns+"default_frame_name", pos_data.activeFrameName);
// load spin rate // load spin rate
nh.getParam("/roboglue_ros_recorder/loop_rate", common_par.loopRate); nh.getParam("/roboglue_ros_recorder/loop_rate", common_par.loopRate);
//load meta template filename //load meta template filename
@@ -263,8 +278,6 @@ int main(int argc, char **argv) {
nh.getParam("/roboglue_ros_recorder/point_group_mode", robot_data.point_group_mode); nh.getParam("/roboglue_ros_recorder/point_group_mode", robot_data.point_group_mode);
nh.getParam("/roboglue_ros_recorder/planning_mode", robot_data.planning_mode); nh.getParam("/roboglue_ros_recorder/planning_mode", robot_data.planning_mode);
/// set console log level ///
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug);
/// set spinner rate /// /// set spinner rate ///
ros::Rate loop_rate(common_par.loopRate); ros::Rate loop_rate(common_par.loopRate);
ROS_INFO("Recorder Node Started"); ROS_INFO("Recorder Node Started");
@@ -305,11 +318,12 @@ int main(int argc, char **argv) {
robot_data.kine_state = std::make_shared<robot_state::RobotState>(robot_data.kine_model); robot_data.kine_state = std::make_shared<robot_state::RobotState>(robot_data.kine_model);
robot_data.joint_modelGroup = robot_data.kine_state->getJointModelGroup(robot_data.move_group_name); robot_data.joint_modelGroup = robot_data.kine_state->getJointModelGroup(robot_data.move_group_name);
robot_data.joint_names = robot_data.joint_modelGroup->getVariableNames(); robot_data.joint_names = robot_data.joint_modelGroup->getVariableNames();
move_group.setPoseReferenceFrame(pos_data.activeFrameName);
ROS_INFO("Planning in Frame: %s for link: %s", move_group.getPlanningFrame().c_str(), move_group.getEndEffectorLink().c_str()); ROS_INFO("Planning in Frame: %s for link: %s", move_group.getPlanningFrame().c_str(), move_group.getEndEffectorLink().c_str());
ROS_INFO("IK calc in Frame: %s", robot_data.kine_model->getModelFrame().c_str()); ROS_INFO("IK calc in Frame: %s", robot_data.kine_model->getModelFrame().c_str());
/// setup rviz palnned path visualization /// setup rviz palnned path visualization
rviz_data.vtools = std::make_shared<mvt::MoveItVisualTools>("base_link", "rviz_visual_tools", robot_data.kine_model); rviz_data.vtools = std::make_shared<mvt::MoveItVisualTools>("world", "rviz_visual_tools", robot_data.kine_model);
bool startCycle = true; bool startCycle = true;
while (ros::ok() && is.isRunning){ while (ros::ok() && is.isRunning){
@@ -331,6 +345,12 @@ int main(int argc, char **argv) {
///////////////////////////////////////// /////////////////////////////////////////
/////////// PLAY FILE /////////////////// /////////// PLAY FILE ///////////////////
///////////////////////////////////////// /////////////////////////////////////////
if (is.setFrame){
rviz_data.vtools->setBaseFrame("planning_frame");
move_group.setPoseReferenceFrame("planning_frame");
rviz_data.vtools->trigger();
is.setFrame = false;
}
if (is.isPlaying){ if (is.isPlaying){
// i -> row counter for temp vector planning in both cartesian and joint mode // i -> row counter for temp vector planning in both cartesian and joint mode
ROS_INFO_COND(i==0,"Start Play file: [%s]", file_data.metaFile->at("name").get<std::string>().c_str()); ROS_INFO_COND(i==0,"Start Play file: [%s]", file_data.metaFile->at("name").get<std::string>().c_str());
@@ -361,7 +381,7 @@ int main(int argc, char **argv) {
tempPlanningVector.clear(); tempPlanningVector.clear();
for (auto cc : tempPlayVector) { for (auto cc : tempPlayVector) {
tempPlanningVector.push_back(twist2Pose(cc.point)); tempPlanningVector.push_back(twist2Pose(cc.point));
tempPlanningVector.back().header.frame_id="/world"; tempPlanningVector.back().header.frame_id=pos_data.activeFrameName;
} }
//TODO sincronizzazione delle uscite ausiliarie con il movimento del robot!!! //TODO sincronizzazione delle uscite ausiliarie con il movimento del robot!!!
//TODO l'invio di traiettorie segmentato in più esecuzioni funziona //TODO l'invio di traiettorie segmentato in più esecuzioni funziona
@@ -442,7 +462,7 @@ int main(int argc, char **argv) {
//////////////////////////////////////// ////////////////////////////////////////
bool openFile(internalState* is, fileData* fd, nlohmann::json meta){ bool openFile(internalState* is, fileData* fd, nlohmann::json meta){
if (!is->isFileOpen){ if (!is->isFileOpen && !meta["name"].get<std::string>().empty()){
// open metafile by name // open metafile by name
std::string metaInFilename = fd->meta_dir_name + meta["name"].get<std::string>() + fd->meta_ext; std::string metaInFilename = fd->meta_dir_name + meta["name"].get<std::string>() + fd->meta_ext;
ROS_DEBUG("Opening Meta File: [%s]", metaInFilename.c_str()); ROS_DEBUG("Opening Meta File: [%s]", metaInFilename.c_str());
@@ -510,6 +530,7 @@ bool openFile(internalState* is, fileData* fd, nlohmann::json meta){
return false; return false;
} }
} }
return false;
} }
bool closeFile(internalState* is, fileData* fd){ bool closeFile(internalState* is, fileData* fd){
@@ -524,7 +545,7 @@ bool closeFile(internalState* is, fileData* fd){
} }
fd->playVect->clear(); fd->playVect->clear();
fd->recordVect->clear(); fd->recordVect->clear();
} } return true;
} }
bool startRecord(internalState* is, fileData* fd, nlohmann::json meta){ bool startRecord(internalState* is, fileData* fd, nlohmann::json meta){
@@ -666,6 +687,7 @@ bool startPlay(internalState* is, fileData* fd, nlohmann::json meta){
return openFile(is,fd,meta); return openFile(is,fd,meta);
else if (!is->isPlaying && is->isFileOpen) else if (!is->isPlaying && is->isFileOpen)
return true; return true;
else return false;
} }
bool stopPlay(internalState* is, fileData* fd){ bool stopPlay(internalState* is, fileData* fd){
@@ -676,7 +698,7 @@ bool stopPlay(internalState* is, fileData* fd){
} }
void plotPoints (rvizData* rvdata, fileData* fd){ void plotPoints (rvizData* rvdata, fileData* fd){
if (fd->playVect != nullptr){ if (fd->playVect != nullptr && fd->playVect->size()>0) {
for(auto point : *fd->playVect){ for(auto point : *fd->playVect){
rvdata->vtools->publishSphere(twist2Pose(point.point).pose, rvt::RED, rvt::MEDIUM); rvdata->vtools->publishSphere(twist2Pose(point.point).pose, rvt::RED, rvt::MEDIUM);
} }
@@ -689,7 +711,10 @@ void plotPoints (rvizData* rvdata, fileData* fd){
} }
void plotTrajectory(rvizData* rvdata, robotData* robotdata, moveit_msgs::RobotTrajectory* traj) { void plotTrajectory(rvizData* rvdata, robotData* robotdata, moveit_msgs::RobotTrajectory* traj) {
rvdata->vtools->setBaseFrame("world");
rvdata->vtools->trigger();
rvdata->vtools->publishTrajectoryLine(*traj, robotdata->joint_modelGroup, rvt::colors::BLUE); rvdata->vtools->publishTrajectoryLine(*traj, robotdata->joint_modelGroup, rvt::colors::BLUE);
rvdata->vtools->setBaseFrame("planning_frame");
rvdata->vtools->trigger(); rvdata->vtools->trigger();
}; };

View File

@@ -121,7 +121,7 @@ int main(int argc, char **argv) {
/// set spinner rate /// /// set spinner rate ///
ros::Rate loop_rate(common_par.loopRate); ros::Rate loop_rate(common_par.loopRate);
/// set console log level /// /// set console log level ///
ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info); ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Warn);
ROS_INFO("Relay Node Started"); ROS_INFO("Relay Node Started");
/// initialize MQTT client /// /// initialize MQTT client ///
mqtt::async_client client(mqtt_topics.mqttHost,""); mqtt::async_client client(mqtt_topics.mqttHost,"");

View File

@@ -6,6 +6,7 @@
/////////////// NODE MANAGEMENT /////////////////// /////////////// NODE MANAGEMENT ///////////////////
////////////////////////////////////////////////// //////////////////////////////////////////////////
bool loadCommonParameters(ros::NodeHandle* nh, COMMON_parameters *p) { bool loadCommonParameters(ros::NodeHandle* nh, COMMON_parameters *p) {
ROS_DEBUG("Node [%s] loading common parameters", ros::this_node::getName().c_str());
nh->getParam(p->param_ns+"INstate", p->ros_topics.stateSub); nh->getParam(p->param_ns+"INstate", p->ros_topics.stateSub);
nh->getParam(p->param_ns+"INcommands", p->ros_topics.commandSub); nh->getParam(p->param_ns+"INcommands", p->ros_topics.commandSub);
nh->getParam(p->param_ns+"INcoordinates", p->ros_topics.coordSub); nh->getParam(p->param_ns+"INcoordinates", p->ros_topics.coordSub);
@@ -21,6 +22,7 @@ bool loadCommonParameters(ros::NodeHandle* nh, COMMON_parameters *p) {
nh->getParam(p->param_ns+"msg_buffer", p->msgBufferSize); nh->getParam(p->param_ns+"msg_buffer", p->msgBufferSize);
nh->getParam(p->param_ns+"startup_msg", p->startupMsg.data); nh->getParam(p->param_ns+"startup_msg", p->startupMsg.data);
nh->getParam(p->param_ns+"shutdown_msg", p->shutdownMsg.data); nh->getParam(p->param_ns+"shutdown_msg", p->shutdownMsg.data);
return true;
} }
void declareStartup(publisherMap* publishers, COMMON_parameters* common_par){ void declareStartup(publisherMap* publishers, COMMON_parameters* common_par){
@@ -103,8 +105,8 @@ geometry_msgs::PoseStamped twist2Pose(geometry_msgs::TwistStamped twt){
newPoseStamp.pose.position.x = twt.twist.linear.x; newPoseStamp.pose.position.x = twt.twist.linear.x;
newPoseStamp.pose.position.z = twt.twist.linear.z; newPoseStamp.pose.position.z = twt.twist.linear.z;
// FIXME ripristinare il calcolo con le coordinate di posa dal tracker, ora gli assi sono fissi // FIXME ripristinare il calcolo con le coordinate di posa dal tracker, ora gli assi sono fissi
//qt.setRPY(twPose.twist.angular.x, twPose.twist.angular.y, twPose.twist.angular.z); qt.setRPY(twt.twist.angular.x, twt.twist.angular.y, twt.twist.angular.z);
qt.setRPY(0, M_PI/2, M_PI/2); //qt.setRPY(0, M_PI/2, M_PI/2);
newPoseStamp.pose.orientation.x = qt.x(); newPoseStamp.pose.orientation.x = qt.x();
newPoseStamp.pose.orientation.y = qt.y(); newPoseStamp.pose.orientation.y = qt.y();
newPoseStamp.pose.orientation.z = qt.z(); newPoseStamp.pose.orientation.z = qt.z();