This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include the main header file | |
#include "ros/ros.h" | |
int main(int argc, char **argv) { | |
// Initialize the node | |
ros::init(argc, argv, "ArgumentParser"); | |
// Print information about the arguments passed | |
std::cout<<argc<<" arguments"<<std::endl; | |
for (int i = 0; i < argc; i++) { | |
std::cout<<"Argument "<<i<<": "<<argv[i]<<std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Import files | |
import rospy | |
import sys | |
# Only if the script is directly run | |
if __name__ == "__main__": | |
# Initialize node | |
rospy.init_node('ArgumentParser_Python', anonymous=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import rospy | |
if __name__ == "__main__": | |
# Initialize the node | |
rospy.init_node("Debugger_Python", anonymous=True) | |
# Rate of 2 times a second (2 Hz) | |
rateHandler = rospy.Rate(2) | |
while (not rospy.is_shutdown()): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ros/ros.h" | |
#include "stdlib.h" | |
int main(int argc, char **argv) { | |
// Initialize ROS node | |
ros::init(argc, argv, "DebuggerCheck"); | |
// Node handler | |
ros::NodeHandle nodeHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Header file for ROS | |
#include "ros/ros.h" | |
// Header file for messages | |
#include "std_msgs/Float64.h" | |
int main(int argc, char **argv) | |
{ | |
// Initialize the node, name it NumberPublisher | |
ros::init(argc, argv, "NumberPublisher"); | |
// Create a node handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Include the ROS header file | |
#include "ros/ros.h" | |
// Message data type | |
#include "std_msgs/Float64.h" | |
// Caller function | |
void receivedMessage(const std_msgs::Float64::ConstPtr &msg) { | |
ROS_INFO("Number received: %f", msg->data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import rospy | |
# Message class | |
from std_msgs.msg import Float64 | |
# Main function | |
def main(): | |
# Initialize node | |
rospy.init_node('NumberPublisher', anonymous= True) | |
# Publisher object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import rospy | |
from std_msgs.msg import Float64 | |
# Function callback | |
def msgReceived(msg): | |
# Parse the received message as Float 64 type | |
message = Float64(msg) | |
# Log that as INFO | |
rospy.loginfo("Received: {0}".format(message.data)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Information | |
string info | |
# Floating point value | |
float64 value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Information | |
string info | |
# Floating point value | |
float64 value |
OlderNewer