diff --git a/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py b/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py index 782ff3d709f276ee1f4dccbc109f487f75fdab36..e137fc0cb603102f906743ff323b27698b1e8d76 100755 --- a/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py +++ b/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py @@ -1,9 +1,11 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import roslib; roslib.load_manifest('crazypkg') +import roslib; roslib.load_manifest('d_fall_pps') import rospy -from crazypkg.msg import ControllerOutputPackage +from d_fall_pps.msg import AngleCommand +from d_fall_pps.msg import RateCommand +from d_fall_pps.msg import MotorCommand # General import @@ -91,25 +93,31 @@ class PPSRadioClient: self._cf.send_packet(pk) def motorCommandCallback(data): - """Callback for motor controller actions""" - cf_client._send_to_commander(0, 0, 0, data.motorCmd1, data.motorCmd2, data.motorCmd3, data.motorCmd4, CONTROLLER_MOTOR) - rospy.loginfo("motor controller callback: %s, %s, %s, %s", data.motorCmd1, data.motorCmd2, data.motorCmd3, data.motorCmd4) + """Callback for motor controller actions""" + rospy.loginfo("test motorCommandCallback") def angleCommandCallback(data): - """Callback for angle controller actions""" - cf_client._send_to_commander(data.roll,data.pitch,data.yaw,data.thrust, 0, 0, 0, 0, CONTROLLER_ANGLE) - rospy.loginfo("angle controller callback: %s, %s, %s", data.roll,data.pitch,data.yaw,data.thrust) + """Callback for angle controller actions""" + ###cf_client._send_to_commander(data.roll,data.pitch,data.yaw,data.thrust, 0, 0, 0, 0, CONTROLLER_ANGLE) + ####rospy.loginfo("angle controller callback: %s, %s, %s", data.roll,data.pitch,data.yaw,data.thrust) + rospy.loginfo("test angleCommandCallback") def rateCommandCallback(data): - """Callback for rate controller actions""" - cf_client._send_to_commander(data.roll,data.pitch,data.yaw,data.thrust, 0, 0, 0, 0, CONTROLLER_RATE) - rospy.loginfo("rate controller callback: %s, %s, %s", data.roll,data.pitch,data.yaw,data.thrust) + """Callback for rate controller actions""" + ###cf_client._send_to_commander(data.roll,data.pitch,data.yaw,data.thrust, 0, 0, 0, 0, CONTROLLER_RATE) + ###rospy.loginfo("rate controller callback: %s, %s, %s", data.roll,data.pitch,data.yaw,data.thrust) + rospy.loginfo("test rateCommandCallback") + +def testCallback(data): + """Callback used to test data receipt if no crazyfly was found""" + rospy.loginfo("Crazyradio.py successfully subscribed and received testvalues: %f", data.cmd1) if __name__ == '__main__': rospy.init_node('CrazyRadio', anonymous=True) # Initialize the low-level drivers (don't list the debug drivers) cflib.crtp.init_drivers(enable_debug_driver=False) + while not rospy.is_shutdown(): # Scan for Crazyflies and use the first one found @@ -126,13 +134,19 @@ if __name__ == '__main__': cf_client = PPSRadioClient(available[0][0]) time.sleep(3.0) #TODO: change publisher name if not correct - rospy.Subscriber("PPSClient/MotorCommands", MotorCommand, motorCommandCallback) - rospy.Subscriber("PPSClient/AngleCommands", AngleCommand, angleCommandCallback) - rospy.Subscriber("PPSClient/RateCommands", RateCommand, rateCommandCallback) + rospy.Subscriber("PPSClient/topicMotorCommand", MotorCommand, motorCommandCallback) + rospy.loginfo("trying to subscribe") + #rospy.Subscriber("PPSClient/AngleCommands", AngleCommand, angleCommandCallback) + #rospy.Subscriber("PPSClient/RateCommands", RateCommand, rateCommandCallback) rospy.spin() else: - rospy.logerr("No Crazyflies found, cannot run example") + #rospy.logerr("No Crazyflies found, cannot run example") + #for testing try to subscribe even if no crazyflie was found + rospy.loginfo("No Crazyflies found, still trying to subscribe") + rospy.Subscriber("PPSClient/topicMotorCommand", MotorCommand, testCallback) + rospy.spin() + time.sleep(0.5) diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/__init__.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/__init__.pyc index c691ab2630d8b6d69d40d6d126cd82676449f86c..f5e936ccbb0fd4da975be38c2a121c3f618e5b17 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/__init__.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/__init__.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/__init__.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/__init__.pyc index 4ce7384997efaabbe7f55a3e6b14360cde89900a..b09a12f550842caeaa953ba1c7a810c6c4aaaf89 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/__init__.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/__init__.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/commander.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/commander.pyc index 60e1d661e5f06bdbfeaf1bbe0d8449209016fa04..1a4551165f13f85143fbb07424587f5960cf074a 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/commander.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/commander.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/console.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/console.pyc index 7dbd2d9d6d6da40aa68d74f41c7059d3ff08e269..7eda3dbedd01ce70ec7b102c900beb60cab58b61 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/console.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/console.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/log.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/log.pyc index 40ace216e4a3a559c79ba9354e98c46ae7d1585c..d210b97174cb49fbd0506298c0ccae2dd1f3d8e8 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/log.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/log.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/mem.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/mem.pyc index d61009696ecb5f8d5e8365430732bb8265f8f88e..81bb975962c1dd992cb3a97871cedbca6f3738ce 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/mem.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/mem.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/param.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/param.pyc index 2f3cf00bc16fad78ecb3bbf4bb7cdd384f04d9ac..300adf07e0912abb81c395eab49e516c272d5c0f 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/param.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/param.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/platformservice.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/platformservice.pyc index e0f185d94aab0d8b11573478ed5d61d8a63cfdf4..c983623f14c9112fa7340dc67dae8cf239564dad 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/platformservice.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/platformservice.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toc.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toc.pyc index aa0e28b806abec352c54ff269edcf545f3adc1a8..4f1b78dbfca9968abd4baa1f92115eb83a5a37ac 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toc.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toc.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toccache.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toccache.pyc index f7ec39db18ee58402fe076ba5710ded82671d339..b8a5da1d4d2221ea5b2848d45378c56f3f277164 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toccache.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crazyflie/toccache.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/__init__.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/__init__.pyc index 69bc9be5a104d24a54da83c47d8b7f4d927a029b..d51361206bc0697d66635adddef42367f3445640 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/__init__.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/__init__.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpdriver.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpdriver.pyc index b3a490ee42b9334900c9ee9cb7b6c67a8c54c7f4..ccd50c1a2b57d9278b134e4e69ca71755eafaea9 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpdriver.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpdriver.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpstack.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpstack.pyc index 3eb90eb5ed7b7874acca4dbdf74ef08c6117a12f..442e4dafa5e3fe75cdaf89fafdabe6efc3fad89e 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpstack.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/crtpstack.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/debugdriver.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/debugdriver.pyc index f28249048fede5906ec54557b98d959df95754e6..6b2576f59196bc4b770a3d5df22a1ff1427fd798 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/debugdriver.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/debugdriver.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/exceptions.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/exceptions.pyc index 3eafb262e3d3ac3a49949b7b8635706859b222b8..60f4731de97ab8939d73b92c20b3cf87f32cdbfe 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/exceptions.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/exceptions.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/radiodriver.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/radiodriver.pyc index 5c813e26bef192cc8be323764abc89307a9d2694..ba8b4dd57c47ce72b0371ab0982658814c939458 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/radiodriver.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/radiodriver.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/serialdriver.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/serialdriver.pyc index cf7f19bdc9799ac60bf5936db90efd5de8f4a75e..a750b4443eac55cb030929271f9cd05899348aec 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/serialdriver.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/serialdriver.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/udpdriver.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/udpdriver.pyc index cb845b82eba07b47050b5b3820bc2441ef2e033a..d1bd738f1d44c57b3967c315484bead65cc82ee4 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/udpdriver.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/udpdriver.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/usbdriver.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/usbdriver.pyc index 0706d7d037264bc184b7d997125cf8538a1288fe..ce85a2d9158d09302e4287d02ca52494a49aea28 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/usbdriver.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/crtp/usbdriver.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/__init__.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/__init__.pyc index 55c08d1fb913181c63048089e35802f5bfab0ad3..3a1be3d44723ddc6e2148aa5d17d34b9b6948f6e 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/__init__.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/__init__.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/cfusb.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/cfusb.pyc index a9e4663144f91afb1d934d409fa194847e80b9b9..8c8e137aa5f0c8add477e9fb323ae6583c6f6e8d 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/cfusb.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/cfusb.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/crazyradio.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/crazyradio.pyc index d1609aa6f8b03c5cca508565b9065d939f830156..fc0771ba3cc7a0596f8cb15beeb6f4c3ad6c6b0c 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/crazyradio.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/drivers/crazyradio.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/__init__.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/__init__.pyc index 9cb912d8126dc08dbd5fbdcd9e63c645575bff6f..9a836124b1252f7c20851b151691a737f68a4bde 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/__init__.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/__init__.pyc differ diff --git a/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/callbacks.pyc b/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/callbacks.pyc index 7a74eeba740be7823fb8adb7248b5c4ead6e1897..74e35185cd8928cfd392adc026a7e4c35c1703a1 100644 Binary files a/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/callbacks.pyc and b/pps_ws/src/d_fall_pps/crazyradio/cflib/utils/callbacks.pyc differ diff --git a/pps_ws/src/d_fall_pps/launch/ppsLaunch.launch b/pps_ws/src/d_fall_pps/launch/ppsLaunch.launch index 8075f51207a04ee4124a3aa2a74f4deffeace73e..b2bb001d03945df3854a76447a42b2074d8b5a6d 100644 --- a/pps_ws/src/d_fall_pps/launch/ppsLaunch.launch +++ b/pps_ws/src/d_fall_pps/launch/ppsLaunch.launch @@ -1,7 +1,6 @@ <launch> - <!-- Might be needed when our CrazyRadio works. There is no CrazyRadio.launch file yet! - <include file="$(find d_fall_pps)/launch/CrazyRadio.launch" /> - --> + + <node pkg="d_fall_pps" name="CrazyRadio" output="screen" type="CrazyRadio.py"/> <node pkg="d_fall_pps" name="ViconDataPublisher" output="screen" type="ViconDataPublisher"> </node> diff --git a/pps_ws/src/d_fall_pps/src/PPSClient.cpp b/pps_ws/src/d_fall_pps/src/PPSClient.cpp index c95e2149cdf8d9e42bdacd1d410a1fcd01894f94..481eeb7b1a378e5686c5beab74f9cc4a168ca494 100644 --- a/pps_ws/src/d_fall_pps/src/PPSClient.cpp +++ b/pps_ws/src/d_fall_pps/src/PPSClient.cpp @@ -26,6 +26,9 @@ #include "ros/ros.h" #include "d_fall_pps/ViconData.h" #include "d_fall_pps/RateController.h" +#include "d_fall_pps/AngleCommand.h" +#include "d_fall_pps/RateCommand.h" +#include "d_fall_pps/MotorCommand.h" using namespace d_fall_pps; @@ -36,6 +39,14 @@ std::string cflie; //global sevices ros::ServiceClient rateClient; +ros::Publisher AngleCommandPublisher; +ros::Publisher RateCommandPublisher; +ros::Publisher MotorCommandPublisher; + +//uncommenting the next line causes FATAL Error at runtime: "You must call ros::init() before creating the first NodeHandle" +//ros::NodeHandle nodeHandle; + + //extract data from "data" and publish/add to service for controller //not void: sould give back controlldata void ppsClientToController(ViconData data){ @@ -138,7 +149,7 @@ void CControlMgr::SendToCrazyflie(ControllerOutput package) { if(m_isStopped) { - m_packageToSend.motorCmd1=0; + c.motorCmd1=0; m_packageToSend.motorCmd2=0; m_packageToSend.motorCmd3=0; m_packageToSend.motorCmd4=0; @@ -168,6 +179,48 @@ void CControlMgr::SendToCrazyflie(ControllerOutput package) */ //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +//callback method to publish d_fall_pps::AngleCommand +void callbackAngleCommand(const ros::TimerEvent&) +{ + d_fall_pps::AngleCommand AngleCommandPkg; + AngleCommandPkg.rollAngle = 1; + AngleCommandPkg.pitchAngle = 1; + AngleCommandPkg.yawAngle = 1; + + AngleCommandPublisher.publish(AngleCommandPkg); + ROS_INFO_STREAM("AngleCommandTimer pubslishes: " << AngleCommandPkg.rollAngle << ", " << AngleCommandPkg.pitchAngle << ", " << AngleCommandPkg.yawAngle); +} + +//callback method to publish d_fall_pps::RateCommand +void callbackRateCommand(const ros::TimerEvent&) +{ + d_fall_pps::RateCommand RateCommandPkg; + RateCommandPkg.rollRate = 2; + RateCommandPkg.pitchRate = 2; + RateCommandPkg.yawRate = 2; + + RateCommandPublisher.publish(RateCommandPkg); + ROS_INFO_STREAM("RateCommandTimer pubslishes: " << RateCommandPkg.rollRate << ", " << RateCommandPkg.pitchRate << ", " << RateCommandPkg.yawRate); +} + +//callback method to publish d_fall_pps::MotorCommand +void callbackMotorCommand(const ros::TimerEvent&) +{ + d_fall_pps::MotorCommand MotorCommandPkg; + MotorCommandPkg.cmd1 = 3; + MotorCommandPkg.cmd2 = 3; + MotorCommandPkg.cmd3 = 3; + MotorCommandPkg.cmd4 = 3; + + MotorCommandPublisher.publish(MotorCommandPkg); + ROS_INFO_STREAM("MotorCommandTimer pubslishes: " << MotorCommandPkg.cmd1 << ", " << MotorCommandPkg.cmd2 << ", " << MotorCommandPkg.cmd3 << ", " << MotorCommandPkg.cmd4); +} + + + + int main(int argc, char* argv[]){ ROS_INFO_STREAM("PPSClient started"); @@ -183,26 +236,26 @@ int main(int argc, char* argv[]){ ROS_ERROR("Failed to get CrazyFlieName"); } - ROS_INFO_STREAM("about to subscribe"); ros::Subscriber ViconSubscriber = nodeHandle.subscribe("/ViconDataPublisher/ViconData", 1, viconCallback); - ROS_INFO_STREAM("subscribed"); + ROS_INFO_STREAM("successfully subscribed to ViconData"); + + //ros::Timers to call method that publishes controller outputs for crayzradio node /* - //publish package_for_crazyradio>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - //m_pNodeHandle=nodeHandle; - //m_pCallbackQueueControlMgr=new ros::CallbackQueue(); - //m_pNodeHandle->setCallbackQueue(m_pCallbackQueueControlMgr); - - - ROS_INFO_STREAM("creating publishers for package_for_crazyradio"); - ros::Pubslisher AngleCommandsPublisher = nodeHandle.advertise <d_fall_pps::AngleCommandsPackage>("AngleCommands", 10)); - ros::Pubslisher AngleCommandsPublisher = nodeHandle.advertise <d_fall_pps::RateCommandsPackage>("RateCommands", 10)); - ros::Pubslisher AngleCommandsPublisher = nodeHandle.advertise <d_fall_pps::MotorCommandsPackage>("MotorCommands", 10)); - - //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + Timers let you schedule a callback to happen at a specific rate through the same callback queue mechanism used by subscription, service, etc. callbacks. + Timers are not a realtime thread/kernel replacement, rather they are useful for things that do not have hard realtime requirements. + Reference: http://wiki.ros.org/roscpp/Overview/Timers */ - - + ROS_INFO("creating publishers for package_for_crazyradio"); + ros::Timer AngleCommandTimer = nodeHandle.createTimer(ros::Duration(0.1), callbackAngleCommand); + ros::Timer RateCommandTimer = nodeHandle.createTimer(ros::Duration(0.1), callbackRateCommand); + ros::Timer MotorCommandTimer = nodeHandle.createTimer(ros::Duration(0.1), callbackMotorCommand); + + + //ros::Publishers to advertise on the three command type topics + AngleCommandPublisher = nodeHandle.advertise <d_fall_pps::AngleCommand>("topicAngleCommand", 1000); + RateCommandPublisher = nodeHandle.advertise<d_fall_pps::RateCommand>("topicRateCommand", 1000); + MotorCommandPublisher = nodeHandle.advertise <d_fall_pps::MotorCommand>("topicMotorCommand", 1000); //service: now only one available: to add several services depending on controller @@ -210,9 +263,6 @@ int main(int argc, char* argv[]){ - - - ros::spin(); return 0; } diff --git a/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp b/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp index 122fec3bdc75f7f9f7854fb8dd34b7e0d62309ca..e56560cf26df04ab1172d7886bcb65f50a4ac583 100644 --- a/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp +++ b/pps_ws/src/d_fall_pps/src/SafeControllerService.cpp @@ -55,7 +55,7 @@ int main(int argc, char* argv[]) { ros::NodeHandle nodeHandle("~"); ros::ServiceServer service = nodeHandle.advertiseService("RateController", calculateControlOutput); - ROS_INFO("SafeControllerService ready"); + ROS_INFO("SafeControllerService ready to send"); ros::spin(); return 0;