Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sipah00's full-sized avatar

Shubham Maddhashiya sipah00

View GitHub Profile
(order, t) = (3, 7.898646981472869)
(errm2, errm1, errp1) = (0.0066714465394643345, 7.06413721038784e-10, 1.2156273602575786e-5)
(order, t) = (3, 7.898648125152829)
(errm2, errm1, errp1) = (0.6671411861345267, 7.064027444712867e-7, 4.431278245404084e-8)
(order, t) = (3, 7.898659561952434)
(errm2, errm1, errp1) = (66.71065078138368, 0.0007063256623599753, 3.0691013381677468e-6)
(order, t) = (3, 7.898773929948488)
cmake_minimum_required(VERSION 2.8.3)
project(talker_listener)
## Find catkin and any catkin packages
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs genmsg)
## Generate added messages and services
generate_messages(DEPENDENCIES std_msgs)
## Declare a catkin package
#include "ros/ros.h"
#include "std_msgs/String.h"
void chatterCallback(const std_msgs::String::ConstPtr& msg){
ROS_INFO("I heard: [%s]", msg->data.c_str());
}
int main(int argc, char **argv){
ros::init(argc, argv, "listener");
ros::NodeHandle n;
ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);
ros::spin();
#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
int main(int argc, char **argv){
ros::init(argc, argv, “talker”);
ros::NodeHandle n;
ros::Publisher chatter_pub = n.advertise<std_msgs::String>(“chatter”, 1000);
ros::Rate loop_rate(10);
int count = 0;
while (ros::ok()){
mkdir src
cd src
catkin_init_workspace
cd ..
catkin_make
echo "source $(pwd)/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
@sipah00
sipah00 / Dependencies.bash
Last active August 16, 2017 06:52
essential
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
@sipah00
sipah00 / zshset.bash
Last active August 16, 2017 06:53
zsh
echo "source /opt/ros/kinetic/setup.zsh" >> ~/.zshrc
source ~/.zshrc
@sipah00
sipah00 / source.bash
Last active August 16, 2017 06:54
source
source /opt/ros/kinetic/setup.bash
@sipah00
sipah00 / en.bash
Last active August 16, 2017 06:55
env setup
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
@sipah00
sipah00 / dep.bash
Last active August 16, 2017 06:55
rosdep
sudo rosdep init
rosdep update