ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

lukevan's profile - activity

2018-09-17 04:13:18 -0500 received badge  Famous Question (source)
2018-08-08 01:39:38 -0500 marked best answer need help on rosserial windows using windows forms

Hi, rosserial windows works on visual studio win32 console mode but does not work on windows forms mode. Here is what I have done:

I am porting win32 Console rosserial_hello_world from http://wiki.ros.org/rosserial_windows... to windows forms in visual studio. It built successfully but when I run the app but the ROS master on Ubuntu did not receive any data. It works on Win32 console mode. Please help. Thanks.

The code for windows forms:

#pragma once

#include <string> #include <stdio.h> #include "ros.h" #include <geometry_msgs twist.h=""> #include <windows.h>

ros::NodeHandle nh; char *ros_master = "192.168.186.132"; geometry_msgs::Twist twist_msg; ros::Publisher cmd_vel_pub ("cmd_vel", &twist_msg); using std::string;

namespace rosserial_hello_world_forms {

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

/// <summary>
/// Summary for Form1
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
    Form1(void)
    {
        InitializeComponent();
        //
        //TODO: Add the constructor code here
        //
    }

protected:
    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    ~Form1()
    {
        if (components)
        {
            delete components;
        }
    }
private: System::Windows::Forms::Timer^  timer1;
private: System::Windows::Forms::Button^  button1;
private: System::Windows::Forms::ListBox^  listBox1;
private: System::Windows::Forms::TextBox^  textBox1;
protected: 
private: System::ComponentModel::IContainer^  components;

private:
    /// <summary>
    /// Required designer variable.
    /// </summary>

#pragma region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> void InitializeComponent(void) { this->components = (gcnew System::ComponentModel::Container()); this->timer1 = (gcnew System::Windows::Forms::Timer(this->components)); this->button1 = (gcnew System::Windows::Forms::Button()); this->listBox1 = (gcnew System::Windows::Forms::ListBox()); this->textBox1 = (gcnew System::Windows::Forms::TextBox()); this->SuspendLayout(); // // timer1 // this->timer1->Interval = 1000; this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick); // // button1 // this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast<system::byte>(0))); this->button1->Location = System::Drawing::Point(135, 22); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(163, 52); this->button1->TabIndex = 0; this->button1->Text = L"button1"; this->button1->UseVisualStyleBackColor = true; this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // listBox1 // this->listBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast<system::byte>(0))); this->listBox1->FormattingEnabled = true; this->listBox1->ItemHeight = 25; this->listBox1->Location = System::Drawing::Point(22, 111); this->listBox1->Name = L"listBox1"; this->listBox1->Size = System::Drawing::Size(383, 79); this->listBox1->TabIndex = 1; // // textBox1 // this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast<system::byte>(0))); this->textBox1->Location = System::Drawing::Point(474, 37); this->textBox1->Name = L"textBox1"; this->textBox1->Size = System::Drawing::Size(336, 30); this->textBox1->TabIndex = 2; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(9, 20); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(431, 244); this->Controls->Add(this->textBox1); this->Controls->Add ... (more)

2018-08-08 01:38:22 -0500 received badge  Famous Question (source)
2018-08-08 01:38:22 -0500 received badge  Notable Question (source)
2018-08-08 01:38:22 -0500 received badge  Popular Question (source)
2017-09-09 22:00:05 -0500 received badge  Notable Question (source)
2017-09-09 22:00:05 -0500 received badge  Popular Question (source)
2017-05-30 01:05:52 -0500 received badge  Enthusiast
2017-05-29 05:01:05 -0500 received badge  Editor (source)
2017-05-29 05:01:05 -0500 edited question Subcriber problem in visual studio C++ windows forms

Subcriber problem in visual studio C++ windows forms Rosserial Windows worked well when I used Visual Studio as describe

2017-05-29 04:58:59 -0500 asked a question Subcriber problem in visual studio C++ windows forms

Subcriber problem in visual studio C++ windows forms Rosserial Windows worked well when I used Visual Studio as describe

2017-05-03 04:36:42 -0500 answered a question need help on rosserial windows using windows forms

FYI, I have already solved the problem. I need to call at least nh.SpinOnce() one time in the initialization thread bef

2017-05-03 03:23:37 -0500 edited question need help on rosserial windows using windows forms

need help on rosserial windows using windows forms Hi, rosserial windows works on visual studio win32 console mode but d

2017-05-02 23:25:22 -0500 asked a question need help on rosserial windows using windows forms

need help on rosserial windows using windows forms Hi, rosserial windows works on visual studio win32 console mode but d