Ask Your Question

Kazuki Kadonaka's profile - activity

2016-06-26 20:02:12 -0500 received badge  Famous Question (source)
2016-03-15 02:32:13 -0500 received badge  Famous Question (source)
2016-03-06 14:47:27 -0500 received badge  Student (source)
2016-01-11 09:17:22 -0500 received badge  Notable Question (source)
2016-01-10 02:37:28 -0500 received badge  Famous Question (source)
2016-01-03 18:38:34 -0500 received badge  Famous Question (source)
2016-01-03 16:15:54 -0500 received badge  Famous Question (source)
2016-01-03 15:00:16 -0500 received badge  Notable Question (source)
2015-12-10 03:00:46 -0500 answered a question Can I use WiringPi on ROS indigo ?

Please check

#include <ros/ros.h>
#include <sensor_msgs/Joy.h>
#include <geometry_msgs/Twist.h>
#include <wiringPi.h> 


class JoyTwist
{
public:
  JoyTwist()
  {
    ros::NodeHandle node;
    joy_sub_ = node.subscribe("joy", 1, &JoyTwist::joyCallback, this);
  }

  void joyCallback(const sensor_msgs::Joy &joy_msg)
  {
    wiringPiSetup(); 
    pinMode(18,OUTPUT); 
    pinMode(19,OUTPUT);
    if (joy_msg.buttons[0] == 1)
    {
      digitalWrite(18, 110 + joy_msg.axes[1] * 10);
      digitalWrite(19, 105 + joy_msg.axes[0] * 15);         
    }
  }
private:
  ros::Subscriber joy_sub_;
};

int main(int argc, char **argv) {
  ros::init(argc, argv, "joy_twist");
  JoyTwist joy_twist;
  ros::spin();
}
2015-12-10 02:59:31 -0500 commented answer Can I use WiringPi on ROS indigo ?

Thanks,please check.

2015-12-07 23:49:43 -0500 commented answer Can I use WiringPi on ROS indigo ?

Thanks your comment.Now studying.

2015-12-07 23:49:21 -0500 commented question Can I use WiringPi on ROS indigo ?

Thanks your comment.Now studying.

2015-12-05 04:19:50 -0500 received badge  Notable Question (source)
2015-12-05 04:08:16 -0500 received badge  Famous Question (source)
2015-12-04 04:07:12 -0500 received badge  Notable Question (source)
2015-11-25 20:44:43 -0500 received badge  Popular Question (source)
2015-11-25 19:03:06 -0500 received badge  Notable Question (source)
2015-11-25 18:51:01 -0500 received badge  Popular Question (source)
2015-11-25 02:10:41 -0500 asked a question Raspberry Pi 2 GPIO

Do you know how to control GPIO. Please teach me how to control GPIO. Please advice.

I use ubuntu 14.04 on Raspberry Pi 2.

2015-11-25 01:24:39 -0500 asked a question Segmentation fault

Please teach me the solution. I use ubuntu 14.04 on Raspberry Pi 2.

#!/usr/bin/env python

import rospy
import roslib
import sys
import RPi.GPIO as GPIO

# Initialize the LED to not be lit.
lit = False

def run():

        # Initialize to use BCM numbering.
    GPIO.setmode(GPIO.BCM)

        # We want pin 18 to be an output pin, and it should start out with a low value.
    GPIO.setup(24, GPIO.OUT, initial=GPIO.LOW)

    rospy.init_node("led_blink", anonymous=False)

        # Set up a timer to toggle the LED state once per second.
    rospy.Timer(rospy.Duration(1.0), timer_callback)
        rospy.spin()
    GPIO.cleanup()


def timer_callback(event):
    global lit

        # Toggle the LED state.
    lit = not lit
    if lit:
        GPIO.output(24, 1)
    else:
        GPIO.output(24, 0)


def main(args):
    run()


if __name__ == "__main__":
    main(sys.argv)

error:

ubuntu@ubuntu:~/catkin_ws/src/rpi_examples_indigo$ rosrun ros_start led_blink.py
Traceback (most recent call last):
  File "/home/ubuntu/catkin_ws/src/rpi_examples_indigo/src/led_blink.py", line 43, in <module>
    main(sys.argv)
  File "/home/ubuntu/catkin_ws/src/rpi_examples_indigo/src/led_blink.py", line 39, in main
    run()
  File "/home/ubuntu/catkin_ws/src/rpi_examples_indigo/src/led_blink.py", line 17, in run
    GPIO.setup(24, GPIO.OUT, initial=GPIO.LOW)
RuntimeError: No access to /dev/mem.  Try running as root!
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# source catkin_ws/devel/setup.bash
root@ubuntu:/home/ubuntu# rosrun ros_start led_blink.py
Segmentation fault (コアダンプ)
2015-11-23 09:46:47 -0500 received badge  Popular Question (source)
2015-11-22 15:22:04 -0500 received badge  Notable Question (source)
2015-11-22 15:22:04 -0500 received badge  Popular Question (source)
2015-11-19 23:13:23 -0500 received badge  Popular Question (source)
2015-11-19 02:16:51 -0500 asked a question ImportError: No module named RPi.GPIO

I use ubuntu 14.04 on Raspberry Pi 2. I installed rpi.gpio

$sudo pip3 install RPi.GPIO 

ubuntu@ubuntu:~/catkin_ws$ rosrun ros_start led_blink.py
Traceback (most recent call last):
 File "/home/ubuntu/catkin_ws/src/ros_start/scripts/led_blink.py", line6, in <module>
    import RPi.GPIO as GPIO
ImportError: No module named RPi.GPIO

Please tell me the solution.

2015-11-19 00:20:05 -0500 received badge  Enthusiast
2015-11-18 08:54:03 -0500 received badge  Popular Question (source)
2015-11-16 23:22:25 -0500 asked a question Can I use WiringPi on ROS indigo ?

Please teach me how to use by ROS indigo.

I can use WiringPi. I can use this program.

#include < iostream >
#include < wiringPi.h >
#include < conio.h >

int main()
{
  if (wiringPiSetupGpio() == \-1) {
    std::cout << "cannot setup gpio." << std::endl;
    return 1;
  }

  pinMode(18, PWM_OUTPUT);
  pinMode(19, PWM_OUTPUT);
  pwmSetMode(PWM_MODE_MS);
  pwmSetClock(266);
  pwmSetRange(1024);
  pwmWrite(18,110);
  pwmWrite(19,105);

  while (1) {
    pwmWrite(18,110);
    if (kbhit() && getch() == 'w'){
      while(1){
      pwmWrite(18,117); //前進
      if(kbhit() && getch() == 'x') break;
       }
    }
    if (kbhit() && getch() == 's'){
      while(1){
      pwmWrite(18,100);//後退
      if(kbhit() && getch() == 'x') break;
       }
    }
    if (kbhit() && getch() == 'd'){
      pwmWrite(19,90);//右旋回
    }
    if (kbhit() && getch() == 'a'){
      pwmWrite(19,120);//左旋回
    }
    if (kbhit() && getch() == 'e'){
      pwmWrite(19,105); //直進
     }
    if (kbhit() && getch() == 'q'){ //停止
    pwmWrite(18,110);
    pwmWrite(19,105);
    break;
    }
  }
  pwmWrite(18,110);
  pwmWrite(19,105);
  return 0;
}

and I want to control. It is recieved joystick data to control GPIO.

2015-11-11 00:02:39 -0500 asked a question How can I control RC car ?

Hello. Please help me. I'm sorry in poor English.

I want to remote control RC car by using PS3 joystick. RC car by Raspberry Pi 2 PS3 joystick by PC

joystick: rosrun joy joy_node

Problem is a program for controlling RC car by using ROS is I do not know. but I can control RC car by using wiringPi. Please teach me.

Raspberry Pi 2 ubuntu14.04 xubuntu ROS indigo

PC ubuntu 14.04 LTS ROS indigo

2015-11-06 11:24:52 -0500 received badge  Famous Question (source)
2015-09-21 02:34:19 -0500 received badge  Notable Question (source)
2015-09-21 02:34:19 -0500 received badge  Popular Question (source)
2015-09-17 04:51:48 -0500 answered a question [rospack] Error: package 'image_view' not found

I didn't have it Thanks

2015-09-17 04:25:30 -0500 asked a question [rospack] Error: package 'image_view' not found

Hi

I use ubuntu14.04 on Raspberry Pi 2 I installed ros-indigo-desktop

I ran the following command

$ roscore 
$ rosrun usb_cam usb_cam_node
$ rosrun image_view image_view image:=/usb_cam/image_raw

rosrun image_view image_view image:=/usb_cam/image_raw caused an error

[rospack] Error: package 'image_view' not found

Please give me some advice

2015-09-17 04:16:33 -0500 received badge  Famous Question (source)
2015-07-19 22:41:22 -0500 received badge  Notable Question (source)
2015-07-13 10:05:21 -0500 received badge  Popular Question (source)
2015-07-13 03:13:33 -0500 asked a question No definition of [geometry_msgs] for OS [debian]

Hi

Installing ROS Hydro on Raspberry Pi

I'm following the tutorial at http://wiki.ros.org/ROSberryPi/Settin...

I ran the following command

$ cd ~/ros_catkin_ws/src
$ roslocate info turtlesim | rosws merge -
$ rosws update
$ cd ..
$ rosdep install  --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy
$ ./src/catkin/bin/catkin_make_isolated --install

$ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy caused an error

ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies:
turtlesim: No definition of [geometry_msgs] for OS [debian]

I don't know how to resolve Please teach me

2015-07-13 03:13:33 -0500 asked a question install turtlesim on Raspberry Pi

Hello

I'm following the tutorial at http://wiki.ros.org/ROSberryPi/Settin...

I ran the following command

$ cd ~/ros_catkin_ws/src $ roslocate info turtlesim | rosws merge - $ rosws update $ cd .. $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y --os=debian:wheezy

ERROR: the following package/stacks could not have their rosdep keys resolved to system dependecies: turtlesim: No definition of [geometry_msgs] for OS [debian]

I don't know how to resolve. Please teach me.